diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..7da0a3cdfad6f437327187d069c6bfc67e06500c --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat @@ -0,0 +1,18 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\gettext-po.h %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\.libs\gettextpo.dll.lib %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-tools\libgettextpo\.libs\gettextpo.dll.lib %LIBRARY_PREFIX%\lib\gettextpo.lib +if errorlevel 1 exit 1 + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..c1239bb32ec550050e270853eeac43944d6b9562 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-tools/libgettextpo/gettext-po.h ${PREFIX}/include/gettext-po.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libgettextpo.*.dylib libgettextpo.dylib +else + test -f libgettextpo.so.0 + ln -s libgettextpo.so.0 libgettextpo.so +fi +popd + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat new file mode 100644 index 0000000000000000000000000000000000000000..962a85abda648c4eb9bcbc8581541cdfd550f31d --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\.libs\gettextpo-0.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh new file mode 100644 index 0000000000000000000000000000000000000000..9e2afdc5569cbbad2164cd670fddfece1d370b9d --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.*.dylib $PREFIX/lib +else + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..e9bc3fef844f8162ffde23b8be8be837afa4c9e7 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat @@ -0,0 +1,17 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\libintl.h %LIBRARY_PREFIX%\include\libintl.h +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\.libs\intl.dll.lib %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-runtime\intl\.libs\intl.dll.lib %LIBRARY_PREFIX%\lib\intl.lib +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..dc72794436c2cc315b6b060b52ffea631257f5cf --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-runtime/intl/libintl.h ${PREFIX}/include/libintl.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libintl.*.dylib libintl.dylib +else + echo "This shouldn't be built on Linux" + exit 1 + # ln -s libintl.so.0 libintl.so +fi +popd diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat new file mode 100644 index 0000000000000000000000000000000000000000..8a582c9db8eab8082a0cfb1fe1600e434aa3d0a3 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\.libs\intl-8.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh new file mode 100644 index 0000000000000000000000000000000000000000..864f86a3dd570c9d897fb92ec9d8d8f6dbe47d4f --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-runtime/intl/.libs/libintl.*.dylib $PREFIX/lib +else + cp ./gettext-runtime/intl/.libs/libintl.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d31928cef7d7580f39bf191f7921ca3fd83401ca --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml @@ -0,0 +1,449 @@ +{% set version = "0.25.1" %} +{% set am_version = "1.15" %} # keep synchronized with build.sh +{% set posix = 'm2-' if win else '' %} +{% set native = 'm2w64-' if win else '' %} + +# Note: as of 0.23.1, we have given up on trying to build gettext on Windows +# with MSVC -- there are new patterns that may make it simply impossible due to +# the ways that some DLL-exported variables are used. See discussion in #35. It +# *is* possible to build gettext on Windows using MinGW/GCC -- see #34. But for +# now we would rather turn off the Windows build than undertake the major +# migration that a switch to GCC would entail. +# +# For the time being, we're not stripping out the Windows build files and +# configuration from this recipe, but they're not being used. + +package: + name: gettext-split + version: {{ version }} + +source: + url: https://ftp.gnu.org/pub/gnu/gettext/gettext-{{ version }}.tar.xz + sha256: 2c8294be238f03fb3fa65b8051057e5b68167f3e21f08008070cf40a7051ba22 + patches: + - patches/0001-Mark-v-snprintf-as-available.patch # [win] + - patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch # [win] + - patches/0003-Fix-some-DLL-export-markings-in-libintl.patch # [win] + - patches/0004-Fix-quoting-when-invoking-windres.patch # [win] + - patches/0005-CXXLD-is-not-a-thing.patch # [win] + - patches/0006-Work-around-Unixisms-in-libgettextpo.patch # [win] + - patches/0007-Add-missing-extern-C-protectors.patch # [win] + - patches/0008-Declaration-ordering.patch # [win] + +build: + number: 0 + skip: true # [win] + +requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - make # [unix] + host: + - libiconv {{ libiconv }} + - ncurses {{ ncurses }} # [not win] + +outputs: + - name: libintl + build: + skip: true # [linux] + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libintl.sh # [unix] + script: install-libintl.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libintl.*.dylib # [osx] + - test -f ${PREFIX}/lib/libintl.so.* # [linux] + - if not exist %PREFIX%\Library\bin\intl-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libintl$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/include/libintl.h # [osx] + - if exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\intl.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\include\libintl.h exit /b1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: library that provides native language support to programs + + - name: libintl-devel + build: + skip: true # [linux] + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libintl-devel.sh # [unix] + script: install-libintl-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('libintl', exact=true) }} + run: + - {{ pin_subpackage('libintl', exact=true) }} + test: + commands: + - test -f ${PREFIX}/lib/libintl${SHLIB_EXT} # [osx] + - test -f ${PREFIX}/include/libintl.h # [osx] + - if not exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\intl.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\include\libintl.h exit /b1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: library that provides native language support to programs + + - name: libasprintf + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libasprintf') }} + ignore_run_exports: + - libiconv + script: install-asprintf.sh # [unix] + script: install-asprintf.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libasprintf.*.dylib # [osx] + - test -f ${PREFIX}/lib/libasprintf.so.0 # [linux] + - if not exist %PREFIX%\Library\bin\asprintf-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libasprintf$SHLIB_EXT # [not win] + - if exist %PREFIX%\Library\lib\asprintf.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\asprintf.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: C-style formatted output in C++ + + - name: libasprintf-devel + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libasprintf') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + ignore_run_exports: + - libiconv + script: install-asprintf-devel.sh # [unix] + script: install-asprintf-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('libasprintf', exact=True) }} + run: + - {{ pin_subpackage('libasprintf', exact=True) }} + test: + commands: + - test -f ${PREFIX}/lib/libasprintf${SHLIB_EXT} # [not win] + - if not exist %PREFIX%\Library\lib\asprintf.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\asprintf.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: Decomposed printf argument list + + - name: libgettextpo + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libgettextpo') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libgettextpo.sh # [unix] + script: install-libgettextpo.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - libiconv {{ libiconv }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libgettextpo.*.dylib # [osx] + - test -f ${PREFIX}/lib/libgettextpo.so.0 # [linux] + - if not exist %PREFIX%\Library\bin\gettextpo-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - if exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\gettextpo.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files + + - name: libgettextpo-devel + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libgettextpo') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libgettextpo-devel.sh # [unix] + script: install-libgettextpo-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libgettextpo', exact=True) }} + - libiconv {{ libiconv }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libgettextpo', exact=True) }} + test: + commands: + - test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - if not exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\gettextpo.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files + + - name: gettext-tools + script: install-gettext.sh # [unix] + script: install-gettext.bat # [not unix] + build: + ignore_run_exports_from: + - {{ compiler('cxx') }} + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - make # [unix] + host: + - libiconv {{ libiconv }} + - ncurses {{ ncurses }} # [not win] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + # Devel packages are included for deduplication-purposes only + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + test: + files: + - an.po + requires: + - ncurses {{ ncurses }} # [not win] + commands: + - msgfmt.exe --help # [win] + - msgfmt.exe -o an.gmo an.po # [win] + - msgfmt -o an.gmo an.po # [not win] + about: + home: https://www.gnu.org/software/gettext + # The binaries of gettext are the GPL-3.0 licensed part. + license: GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package (executable tools) + + - name: gettext + build: + # Required to make overdepending checks pass. + ignore_run_exports: + - libintl + - libasprintf + - libgettextpo + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} # [not linux] + - {{ pin_subpackage('libasprintf') }} + - {{ pin_subpackage('libgettextpo') }} + script: install-gettext.sh # [unix] + script: install-gettext.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('gettext-tools', exact=True) }} + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + run: + - {{ pin_subpackage('gettext-tools', exact=True) }} + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + test: + commands: + # ===== gettextlib ===== + - test -f ${PREFIX}/lib/libgettextlib$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextlib.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextlib.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextlib-*.dll exit /b 1 # [win] + # ===== gettextpo ===== + - test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextpo.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextpo-*.dll exit /b 1 # [win] + # ===== gettextsrc ===== + - test -f ${PREFIX}/lib/libgettextsrc$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextsrc.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextsrc.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextsrc-*.dll exit /b 1 # [win] + # ===== intl (not on linux) ===== + - test -f ${PREFIX}/lib/libintl$SHLIB_EXT # [not win and not linux] + - test ! -f ${PREFIX}/lib/libintl.a # [not win and not linux] + - if not exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\intl-*.dll exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later AND GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package + +about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later AND GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package + description: | + gettext utilities are a set of tools that provides a framework to help + other GNU packages produce multi-lingual messages. These tools include + a set of conventions about how programs should be written to support message + catalogs, a directory and file naming organization for the message catalogs themselves + dev_url: https://www.gnu.org/software/gettext + doc_url: https://www.gnu.org/software/gettext/manual + +extra: + feedstock-name: gettext + recipe-maintainers: + - scopatz + - ocefpaf + - pkgw + - xhochy diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh new file mode 100644 index 0000000000000000000000000000000000000000..397e2e76a9dee4c89a2f4d51c8a74d7e5b8de44e --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Needed because "windres" can't handle a preprocesser whose invocation is +# more than one word. +exec cl -nologo -E -DRC_INVOKED "$@" diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch new file mode 100644 index 0000000000000000000000000000000000000000..c956670a1931c785b1c504d4e67cb7b5c8e2cd9a --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch @@ -0,0 +1,84 @@ +From 4fa8feff0af88fb3c7dd3fceb722dabe48b6dfa0 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:28:40 -0400 +Subject: [PATCH 1/8] Mark (v)snprintf as available + +`configure` checks whether `snprintf` is available by attempting to link with +it. Windows didn't used to provide it at all. However, newer Windows does +provide it, but as an inline C implementation, so direct linking doesn't work. +For our purposes, the inline implementation is equivalent to a libc that +provides the functions, so hack our configure scripts to mark these functions +as available. +--- + configure.ac | 2 ++ + gettext-runtime/configure.ac | 2 ++ + gettext-runtime/libasprintf/configure.ac | 2 ++ + gettext-tools/configure.ac | 2 ++ + gettext-tools/examples/configure.ac | 2 ++ + 5 files changed, 10 insertions(+) + +diff --git a/configure.ac b/configure.ac +index f4e54ea..ef64e67 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c]) + AC_CONFIG_AUX_DIR([build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar]) + + dnl Override automake's tar command used for creating distributions. +diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac +index 126d069..66f26fa 100644 +--- a/gettext-runtime/configure.ac ++++ b/gettext-runtime/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-runtime], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([intl/dcigettext.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac +index 2fe76cf..31a06db 100644 +--- a/gettext-runtime/libasprintf/configure.ac ++++ b/gettext-runtime/libasprintf/configure.ac +@@ -20,6 +20,8 @@ AC_PREREQ([2.64]) + AC_INIT([libasprintf], [1.0]) + AC_CONFIG_SRCDIR([vasprintf.c]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index 3610ee3..6c75ccc 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-tools], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([src/msgfmt.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-tools/examples/configure.ac b/gettext-tools/examples/configure.ac +index 249fd14..4db994e 100644 +--- a/gettext-tools/examples/configure.ac ++++ b/gettext-tools/examples/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-examples], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([installpaths.in]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) + + dnl Installation directories. diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch new file mode 100644 index 0000000000000000000000000000000000000000..11fa4a51862263fe4b5370e4cc6a0d9551f8c9ef --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch @@ -0,0 +1,79 @@ +From e11f7bc727a6a3029c2f5b8f3002cd70817b2a8c Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:32:14 -0400 +Subject: [PATCH 2/8] Prevent libtool from worrying about dependent libraries + too much. + +Dependent libraries on Windows can take on a lot of names, depending on how +packagers mix and match "lib" prefixes, ".lib" vs. ".a" suffixes, and so on. +Libtool isn't great at guessing them. By hacking cache variables in the +`configure.ac` scripts, we can force it to just go ahead and pass everything +and not worry about it. +--- + configure.ac | 1 + + gettext-runtime/configure.ac | 1 + + gettext-runtime/libasprintf/configure.ac | 1 + + gettext-tools/configure.ac | 1 + + gettext-tools/examples/configure.ac | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index ef64e67..05a7d18 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c]) + AC_CONFIG_AUX_DIR([build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar]) +diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac +index 66f26fa..7e914f8 100644 +--- a/gettext-runtime/configure.ac ++++ b/gettext-runtime/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-runtime], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([intl/dcigettext.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) +diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac +index 31a06db..3a89c61 100644 +--- a/gettext-runtime/libasprintf/configure.ac ++++ b/gettext-runtime/libasprintf/configure.ac +@@ -20,6 +20,7 @@ AC_PREREQ([2.64]) + AC_INIT([libasprintf], [1.0]) + AC_CONFIG_SRCDIR([vasprintf.c]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index 6c75ccc..fa01857 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-tools], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([src/msgfmt.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) +diff --git a/gettext-tools/examples/configure.ac b/gettext-tools/examples/configure.ac +index 4db994e..6a59715 100644 +--- a/gettext-tools/examples/configure.ac ++++ b/gettext-tools/examples/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-examples], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([installpaths.in]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch new file mode 100644 index 0000000000000000000000000000000000000000..732eccd29ebdd82ac3252525b0e8f617d66090d2 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch @@ -0,0 +1,110 @@ +From d7490b79ce621dc4d859c1a82712f2ffe7366593 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:34:54 -0400 +Subject: [PATCH 3/8] Fix some DLL export markings in libintl. + +A few files had inconsistent labeling for DLL exporting, which I guess MSVC +might be pickier about than it used to be. Tidy them up. +--- + gettext-runtime/gnulib-lib/relocatable.c | 2 +- + gettext-runtime/intl/libgnuintl.in.h | 15 ++++++++++++--- + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/gettext-runtime/gnulib-lib/relocatable.c b/gettext-runtime/gnulib-lib/relocatable.c +index 365c085..5f7fad6 100644 +--- a/gettext-runtime/gnulib-lib/relocatable.c ++++ b/gettext-runtime/gnulib-lib/relocatable.c +@@ -164,7 +164,7 @@ set_this_relocation_prefix (const char *orig_prefix_arg, + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +-void ++RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) + { + set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h +index ae81ffe..487675d 100644 +--- a/gettext-runtime/intl/libgnuintl.in.h ++++ b/gettext-runtime/intl/libgnuintl.in.h +@@ -48,6 +48,15 @@ + # undef gettext + #endif + ++ ++#if HAVE_VISIBILITY && BUILDING_DLL ++# define DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_DLL ++# define DLL_EXPORTED __declspec(dllexport) ++#else ++# define DLL_EXPORTED ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -1095,7 +1104,7 @@ char *setlocale (int __category, const char *__locale) + # undef setlocale + # define setlocale libintl_setlocale + # endif +-extern char *setlocale (int, const char *) ++extern DLL_EXPORTED char *setlocale (int, const char *) + _INTL_ASM (libintl_setlocale); + # if defined _INTL_REDIRECT_MACROS && defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE + namespace std { using ::libintl_setlocale; } +@@ -1123,7 +1132,7 @@ locale_t newlocale (int __category_mask, const char *__name, locale_t __base) + # undef newlocale + # define newlocale libintl_newlocale + # endif +-extern locale_t newlocale (int, const char *, locale_t) ++extern DLL_EXPORTED locale_t newlocale (int, const char *, locale_t) + _INTL_ASM (libintl_newlocale); + # if defined _INTL_REDIRECT_MACROS && defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE + namespace std { using ::libintl_newlocale; } +@@ -1144,7 +1153,7 @@ namespace std { using ::libintl_newlocale; } + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ + #define libintl_set_relocation_prefix libintl_set_relocation_prefix +-extern void ++extern DLL_EXPORTED void + libintl_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index dcbf1d7..47b0a1c 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -392,8 +392,12 @@ AH_BOTTOM([ + the C macro DLL_EXPORT (together with PIC) when compiling for a shared + library (called DLL under Windows) and does not define it when compiling + an object file meant to be linked statically into some executable. */ +-#if (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER +-# define DLL_VARIABLE __declspec (dllimport) ++#if (defined _WIN32 || defined __CYGWIN__) && !defined IN_RELOCWRAPPER ++# if defined DLL_EXPORT ++# define DLL_VARIABLE __declspec (dllexport) ++# else ++# define DLL_VARIABLE __declspec (dllimport) ++# endif + #else + # define DLL_VARIABLE + #endif +diff --git a/gettext-runtime/intl/configure.ac b/gettext-runtime/intl/configure.ac +index 749a700..a74c122 100755 +--- a/gettext-runtime/intl/configure.ac ++++ b/gettext-runtime/intl/configure.ac +@@ -235,8 +235,12 @@ AH_BOTTOM([ + the C macro DLL_EXPORT (together with PIC) when compiling for a shared + library (called DLL under Windows) and does not define it when compiling + an object file meant to be linked statically into some executable. */ +-#if (defined _MSC_VER && defined DLL_EXPORT) && !defined IN_RELOCWRAPPER +-# define DLL_VARIABLE __declspec (dllimport) ++#if defined _MSC_VER && !defined IN_RELOCWRAPPER ++# if defined DLL_EXPORT ++# define DLL_VARIABLE __declspec (dllexport) ++# else ++# define DLL_VARIABLE __declspec (dllimport) ++# endif + #else + # define DLL_VARIABLE + #endif diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch new file mode 100644 index 0000000000000000000000000000000000000000..5318fefa1d760dd5016bad98c2693d27d67230ac --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch @@ -0,0 +1,120 @@ +From 62972ab62dd216ef95df90187487d14bc86e5def Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:36:09 -0400 +Subject: [PATCH 4/8] Fix quoting when invoking "windres" + +Version strings were being quoted too much. I'm not sure why this wasn't a +problem elsewhere, but it's definitely a problem on Windows. +--- + gettext-runtime/intl/Makefile.am | 2 +- + gettext-runtime/libasprintf/Makefile.am | 2 +- + gettext-runtime/src/Makefile.am | 2 +- + gettext-tools/libgettextpo/Makefile.am | 2 +- + gettext-tools/src/Makefile.am | 2 +- + libtextstyle/lib/Makefile.am | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am +index 2bed67b..ae4123e 100644 +--- a/gettext-runtime/intl/Makefile.am ++++ b/gettext-runtime/intl/Makefile.am +@@ -411,7 +411,7 @@ libintl.res.lo: $(srcdir)/libintl.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-runtime/libasprintf/Makefile.am b/gettext-runtime/libasprintf/Makefile.am +index c0eb406..4ca6b0a 100644 +--- a/gettext-runtime/libasprintf/Makefile.am ++++ b/gettext-runtime/libasprintf/Makefile.am +@@ -99,7 +99,7 @@ libasprintf.res.lo: $(srcdir)/libasprintf.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-runtime/src/Makefile.am b/gettext-runtime/src/Makefile.am +index e9974c4..9da1c7b 100644 +--- a/gettext-runtime/src/Makefile.am ++++ b/gettext-runtime/src/Makefile.am +@@ -70,7 +70,7 @@ RELOCATABLE_STRIP = : + if WOE32 + WOE32_LDADD = gettext.res + gettext.res : $(top_srcdir)/../windows/gettext.rc +- $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff ++ $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff + MOSTLYCLEANFILES += gettext.res + else + WOE32_LDADD = +diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am +index 5fc6708..98d65cc 100644 +--- a/gettext-tools/libgettextpo/Makefile.am ++++ b/gettext-tools/libgettextpo/Makefile.am +@@ -146,7 +146,7 @@ EXTRA_DIST += libgettextpo.rc + if WOE32 + WOE32_LIBADD = libgettextpo.res.lo + libgettextpo.res.lo : $(srcdir)/libgettextpo.rc +- $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff ++ $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff + MOSTLYCLEANFILES += libgettextpo.res.lo + else + WOE32_LIBADD = +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index f77129d..0f77ee8 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -756,7 +756,7 @@ RELOCATABLE_STRIP = : + if WOE32 + WOE32_LDADD = gettext.res + gettext.res : $(top_srcdir)/../windows/gettext.rc +- $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff ++ $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff + MOSTLYCLEANFILES += gettext.res + else + WOE32_LDADD = +diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am +index bf4b408..59810c1 100644 +--- a/libtextstyle/lib/Makefile.am ++++ b/libtextstyle/lib/Makefile.am +@@ -268,7 +268,7 @@ libtextstyle.res.lo: $(srcdir)/libtextstyle.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-tools/gnulib-lib/Makefile.am_orig b/gettext-tools/gnulib-lib/Makefile.am +index a7e7d88..7dc2e6b 100644 +--- a/gettext-tools/gnulib-lib/Makefile.am_orig ++++ b/gettext-tools/gnulib-lib/Makefile.am +@@ -76,7 +76,7 @@ libgettextlib.res.lo: $(srcdir)/libgettextlib.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 607dcf0..23231cb 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -372,7 +372,7 @@ libgettextsrc.res.lo: $(srcdir)/libgettextsrc.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch new file mode 100644 index 0000000000000000000000000000000000000000..0fe985162a8a225bd6c953411748c6bdd3bbcbf5 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch @@ -0,0 +1,88 @@ +From 8538d082c870ef99bccb8c48acc0c40e525c07cb Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:37:12 -0400 +Subject: [PATCH 5/8] CXXLD is not a thing. + +Maybe it was at some point? But it isn't now. CCLD works fine on Windows since +CC and CXX (the C and C++ compilers) are the same thing. +--- + gettext-tools/gnulib-lib/Makefile.am | 2 +- + gettext-tools/src/Makefile.am | 22 +++++++++++----------- + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/gettext-tools/gnulib-lib/Makefile.am b/gettext-tools/gnulib-lib/Makefile.am +index a7fa494..a7e7d88 100644 +--- a/gettext-tools/gnulib-lib/Makefile.am ++++ b/gettext-tools/gnulib-lib/Makefile.am +@@ -111,7 +111,7 @@ libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + else + libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \ + -o $@ + # Use the same definition of CXXLD as Automake generates in other Makefiles. + CXXLD = $(CXX) +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 036ec64..607dcf0 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -552,47 +552,47 @@ xgettext_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + else + libgettextsrc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextsrc_la_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextsrc_la_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgattrib_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgattrib_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgattrib_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgcat_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcat_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcat_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgcomm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcomm_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcomm_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgconv_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgconv_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgconv_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgen_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgen_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgfilter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgfilter_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgfilter_LDFLAGS) $(LDFLAGS) \ + -o $@ + msggrep_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msggrep_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msggrep_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgmerge_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(msgmerge_CXXFLAGS) $(CXXFLAGS) $(msgmerge_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(msgmerge_CXXFLAGS) $(CXXFLAGS) $(msgmerge_LDFLAGS) $(LDFLAGS) \ + -o $@ + msguniq_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msguniq_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msguniq_LDFLAGS) $(LDFLAGS) \ + -o $@ + xgettext_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(xgettext_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(xgettext_LDFLAGS) $(LDFLAGS) \ + -o $@ + endif + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch new file mode 100644 index 0000000000000000000000000000000000000000..1fae592458d921cf736ba4d89bf5d8349ceb9241 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch @@ -0,0 +1,40 @@ +From cf1eb94eb581d73c3079a71955f5d2d9a307a5ca Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:39:00 -0400 +Subject: [PATCH 6/8] Work around Unixisms in libgettextpo + +There's a complicated bit of shell magic here that relies on redirecting +program output to file descriptor #5. That seems not to work on Windows. Just +use a temporary file instead. +--- + gettext-tools/libgettextpo/Makefile.am | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am +index 98d65cc..9cfb6ce 100644 +--- a/gettext-tools/libgettextpo/Makefile.am ++++ b/gettext-tools/libgettextpo/Makefile.am +@@ -174,7 +174,7 @@ config.h: $(BUILT_SOURCES) + echo '#endif /* GTPO_CONFIG_H */'; \ + } > config.h && \ + if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \ +- { \ ++ { rm -f CONFIG_H_LISTING.txt; \ + for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \ + case $$f in \ + *.c | *.$(OBJEXT) | *.lo ) \ +@@ -182,12 +182,12 @@ config.h: $(BUILT_SOURCES) + test -f $$sf || sf=$(srcdir)/$$sf; \ + of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \ + $(COMPILE) $(DEFS) $(GL_CFLAG_INHIBIT_WARNINGS) -c $$sf || { rm -f config.h; exit 1; }; \ +- sh ./exported.sh $$of 1>&5; \ ++ sh ./exported.sh $$of >>CONFIG_H_LISTING.txt; \ + rm -f $$of `echo "$$of" | sed -e 's,\\.$(OBJEXT)$$,.lo,'`; \ + ;; \ + esac; \ + done; \ +- } 5>&1 1>&2 \ ++ }; cat CONFIG_H_LISTING.txt \ + | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | sed -e 's,^obstack_free$$,__obstack_free,' \ + | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \ diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch new file mode 100644 index 0000000000000000000000000000000000000000..68136ea8c5fe43f36403968dbae865e66ec028b3 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch @@ -0,0 +1,40 @@ +From 7c58479500f1caf6085662ead8702cf06127deb0 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:54:36 -0400 +Subject: [PATCH 7/8] Add missing 'extern "C"' protectors + +Various files are missing 'extern "C"' blocks around C declarations. + +The context here is that on Windows, some files are compiled as C++ code even +though they're written as pretty much straight C. The motivation seems to be +that MSVC doesn't fully support C99 or C11, specifically non-constant +initializers. But C++ allows this, so the code will come out fine if compiled +as C++. However, without proper 'extern "C"' protection, you get linkage +errors. +--- + gettext-tools/src/plural-table.h | 8 ++++++++ + +diff --git a/gettext-tools/src/plural-table.h b/gettext-tools/src/plural-table.h +index e6c52bb..d736ef0 100644 +--- a/gettext-tools/src/plural-table.h ++++ b/gettext-tools/src/plural-table.h +@@ -20,6 +20,10 @@ + + #include + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + struct plural_table_entry + { + const char *lang; +@@ -30,4 +34,8 @@ struct plural_table_entry + extern DLL_VARIABLE struct plural_table_entry plural_table[]; + extern DLL_VARIABLE const size_t plural_table_size; + ++#ifdef __cplusplus ++} ++#endif ++ + #endif /* _PLURAL_TABLE_H */ diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch new file mode 100644 index 0000000000000000000000000000000000000000..284901d912736be394ca5a676ce19ef206839758 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch @@ -0,0 +1,21 @@ +In gettext-tools, both `libgrep` and `gnulib-lib` provide their own versions of +headers like `stdlib.h`, but the two variants aren't the same. Some of the tools +want to use `unsetenv()` as provided by gnulib-lib, but the default include flag +ordering puts libgrep first, which doesn't define it. This is all pretty messy +but the most expedient thing is to reorder the includes to get the gnulib-lib +version first. + +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 607dcf0..c641919 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -109,8 +109,8 @@ schemadir = $(pkgdatadir)/schema + # The option -I$(top_srcdir) is needed so that woe32dll/export.h is found. + AM_CPPFLAGS = \ + -I$(top_srcdir) \ +- -I../libgrep -I$(top_srcdir)/libgrep \ + -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ ++ -I../libgrep -I$(top_srcdir)/libgrep \ + -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl + DEFS = \ + -DLOCALEDIR=$(localedir_c_make) \ diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/test/run_test.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..fea4ced4dcd9edf872f1d39a6e25bde94551cab0 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +test -f ${PREFIX}/lib/libgettextpo.so.0 +test ! -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT +exit 0 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/include/gettext-po.h b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/include/gettext-po.h new file mode 100644 index 0000000000000000000000000000000000000000..fec8204e23c26e1dca39917002ca4d1bc54a1725 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/include/gettext-po.h @@ -0,0 +1,360 @@ +/* Public API for GNU gettext PO files - contained in libgettextpo. + Copyright (C) 2003-2025 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GETTEXT_PO_H +#define _GETTEXT_PO_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* =========================== Meta Information ============================ */ + +/* Version number: (major<<16) + (minor<<8) + subminor */ +#define LIBGETTEXTPO_VERSION 0x001900 +extern int libgettextpo_version; + +/* ================================= Types ================================= */ + +/* A po_file_t represents the contents of a PO file. */ +typedef struct po_file *po_file_t; + +/* A po_message_iterator_t represents an iterator through a domain of a + PO file. */ +typedef struct po_message_iterator *po_message_iterator_t; + +/* A po_message_t represents a message in a PO file. */ +typedef struct po_message *po_message_t; + +/* A po_filepos_t represents a string's position within a source file. */ +typedef struct po_filepos *po_filepos_t; + +/* A po_error_handler handles error situations. No longer used. */ +struct po_error_handler +{ + /* Signal an error. The error message is built from FORMAT and the following + arguments. ERRNUM, if nonzero, is an errno value. + Must increment the error_message_count variable declared in error.h. + Must not return if STATUS is nonzero. */ + void (*error) (int status, int errnum, + const char *format, ...) +#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__ + __attribute__ ((__format__ (__printf__, 3, 4))) +#endif + ; + + /* Signal an error. The error message is built from FORMAT and the following + arguments. The error location is at FILENAME line LINENO. ERRNUM, if + nonzero, is an errno value. + Must increment the error_message_count variable declared in error.h. + Must not return if STATUS is nonzero. */ + void (*error_at_line) (int status, int errnum, + const char *filename, unsigned int lineno, + const char *format, ...) +#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__ + __attribute__ ((__format__ (__printf__, 5, 6))) +#endif + ; + + /* Signal a multiline warning. The PREFIX applies to all lines of the + MESSAGE. Free the PREFIX and MESSAGE when done. */ + void (*multiline_warning) (char *prefix, char *message); + + /* Signal a multiline error. The PREFIX applies to all lines of the + MESSAGE. Free the PREFIX and MESSAGE when done. + Must increment the error_message_count variable declared in error.h if + PREFIX is non-NULL. */ + void (*multiline_error) (char *prefix, char *message); +}; +typedef const struct po_error_handler *po_error_handler_t; + +/* A po_xerror_handler handles warnings, error and fatal error situations. */ +#define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */ +#define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */ +#define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */ +struct po_xerror_handler +{ + /* Signal a problem of the given severity. + MESSAGE and/or FILENAME + LINENO indicate where the problem occurred. + If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored. + If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored. + If COLUMN is (size_t)(-1), it should be ignored. + MESSAGE_TEXT is the problem description (if MULTILINE_P is true, + multiple lines of text, each terminated with a newline, otherwise + usually a single line). + Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */ + void (*xerror) (int severity, + po_message_t message, + const char *filename, size_t lineno, size_t column, + int multiline_p, const char *message_text); + /* Signal a problem that refers to two messages. + Similar to two calls to xerror. + If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to + MESSAGE_TEXT2. */ + void (*xerror2) (int severity, + po_message_t message1, + const char *filename1, size_t lineno1, size_t column1, + int multiline_p1, const char *message_text1, + po_message_t message2, + const char *filename2, size_t lineno2, size_t column2, + int multiline_p2, const char *message_text2); +}; +typedef const struct po_xerror_handler *po_xerror_handler_t; + +/* Memory allocation: + The memory allocations performed by these functions use xmalloc(), + therefore will cause a program exit if memory is exhausted. + The memory allocated by po_file_read, and implicitly returned through + the po_message_* functions, lasts until freed with po_file_free. */ + + +/* ============================= po_file_t API ============================= */ + +/* Create an empty PO file representation in memory. */ +extern po_file_t po_file_create (void); + +/* Read a PO file into memory. + Return its contents. Upon failure, call function from handler. */ +#define po_file_read po_file_read_v3 +extern po_file_t po_file_read (const char *filename, + po_xerror_handler_t handler); + +/* Write an in-memory PO file to a file. + Upon failure, call function from handler. */ +#define po_file_write po_file_write_v2 +extern po_file_t po_file_write (po_file_t file, const char *filename, + po_xerror_handler_t handler); + +/* Free a PO file from memory. */ +extern void po_file_free (po_file_t file); + +/* Return the names of the domains covered by a PO file in memory. */ +extern const char * const * po_file_domains (po_file_t file); + + +/* =========================== Header entry API ============================ */ + +/* Return the header entry of a domain of a PO file in memory. + The domain NULL denotes the default domain. + Return NULL if there is no header entry. */ +extern const char * po_file_domain_header (po_file_t file, const char *domain); + +/* Return the value of a field in a header entry. + The return value is either a freshly allocated string, to be freed by the + caller, or NULL. */ +extern char * po_header_field (const char *header, const char *field); + +/* Return the header entry with a given field set to a given value. The field + is added if necessary. + The return value is a freshly allocated string. */ +extern char * po_header_set_field (const char *header, const char *field, const char *value); + + +/* ======================= po_message_iterator_t API ======================= */ + +/* Create an iterator for traversing a domain of a PO file in memory. + The domain NULL denotes the default domain. */ +extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain); + +/* Free an iterator. */ +extern void po_message_iterator_free (po_message_iterator_t iterator); + +/* Return the next message, and advance the iterator. + Return NULL at the end of the message list. */ +extern po_message_t po_next_message (po_message_iterator_t iterator); + +/* Insert a message in a PO file in memory, in the domain and at the position + indicated by the iterator. The iterator thereby advances past the freshly + inserted message. */ +extern void po_message_insert (po_message_iterator_t iterator, po_message_t message); + + +/* =========================== po_message_t API ============================ */ + +/* Return a freshly constructed message. + To finish initializing the message, you must set the msgid and msgstr. */ +extern po_message_t po_message_create (void); + +/* Return the context of a message, or NULL for a message not restricted to a + context. */ +extern const char * po_message_msgctxt (po_message_t message); + +/* Change the context of a message. NULL means a message not restricted to a + context. */ +extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt); + +/* Return the msgid (untranslated English string) of a message. */ +extern const char * po_message_msgid (po_message_t message); + +/* Change the msgid (untranslated English string) of a message. */ +extern void po_message_set_msgid (po_message_t message, const char *msgid); + +/* Return the msgid_plural (untranslated English plural string) of a message, + or NULL for a message without plural. */ +extern const char * po_message_msgid_plural (po_message_t message); + +/* Change the msgid_plural (untranslated English plural string) of a message. + NULL means a message without plural. */ +extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural); + +/* Return the msgstr (translation) of a message. + Return the empty string for an untranslated message. */ +extern const char * po_message_msgstr (po_message_t message); + +/* Change the msgstr (translation) of a message. + Use an empty string to denote an untranslated message. */ +extern void po_message_set_msgstr (po_message_t message, const char *msgstr); + +/* Return the msgstr[index] for a message with plural handling, or + NULL when the index is out of range or for a message without plural. */ +extern const char * po_message_msgstr_plural (po_message_t message, int index); + +/* Change the msgstr[index] for a message with plural handling. + Use a NULL value at the end to reduce the number of plural forms. */ +extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr); + +/* Return the comments for a message. */ +extern const char * po_message_comments (po_message_t message); + +/* Change the comments for a message. + comments should be a multiline string, ending in a newline, or empty. */ +extern void po_message_set_comments (po_message_t message, const char *comments); + +/* Return the extracted comments for a message. */ +extern const char * po_message_extracted_comments (po_message_t message); + +/* Change the extracted comments for a message. + comments should be a multiline string, ending in a newline, or empty. */ +extern void po_message_set_extracted_comments (po_message_t message, const char *comments); + +/* Return the i-th file position for a message, or NULL if i is out of + range. */ +extern po_filepos_t po_message_filepos (po_message_t message, int i); + +/* Remove the i-th file position from a message. + The indices of all following file positions for the message are decremented + by one. */ +extern void po_message_remove_filepos (po_message_t message, int i); + +/* Add a file position to a message, if it is not already present for the + message. + file is the file name. + start_line is the line number where the string starts, or (size_t)(-1) if no + line number is available. */ +extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line); + +/* Return the previous context of a message, or NULL for none. */ +extern const char * po_message_prev_msgctxt (po_message_t message); + +/* Change the previous context of a message. NULL is allowed. */ +extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt); + +/* Return the previous msgid (untranslated English string) of a message, or + NULL for none. */ +extern const char * po_message_prev_msgid (po_message_t message); + +/* Change the previous msgid (untranslated English string) of a message. + NULL is allowed. */ +extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid); + +/* Return the previous msgid_plural (untranslated English plural string) of a + message, or NULL for none. */ +extern const char * po_message_prev_msgid_plural (po_message_t message); + +/* Change the previous msgid_plural (untranslated English plural string) of a + message. NULL is allowed. */ +extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural); + +/* Return true if the message is marked obsolete. */ +extern int po_message_is_obsolete (po_message_t message); + +/* Change the obsolete mark of a message. */ +extern void po_message_set_obsolete (po_message_t message, int obsolete); + +/* Return true if the message is marked fuzzy. */ +extern int po_message_is_fuzzy (po_message_t message); + +/* Change the fuzzy mark of a message. */ +extern void po_message_set_fuzzy (po_message_t message, int fuzzy); + +/* Return true if the message is marked as being a format string of the given + type (e.g. "c-format"). */ +extern int po_message_is_format (po_message_t message, const char *format_type); + +/* Change the format string mark for a given type of a message. + Pass value = 1 to assert the format string mark (e.g. "c-format"), + value = 0 to assert the opposite (leading to e.g. "no-c-format"), + or value = -1 to remove the format string mark and its opposite. */ +extern void po_message_set_format (po_message_t message, const char *format_type, int value); + +/* If a numeric range of a message is set, return true and store the minimum + and maximum value in *MINP and *MAXP. */ +extern int po_message_is_range (po_message_t message, int *minp, int *maxp); + +/* Change the numeric range of a message. MIN and MAX must be non-negative, + with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a + message. */ +extern void po_message_set_range (po_message_t message, int min, int max); + + +/* =========================== po_filepos_t API ============================ */ + +/* Return the file name. */ +extern const char * po_filepos_file (po_filepos_t filepos); + +/* Return the line number where the string starts, or (size_t)(-1) if no line + number is available. */ +extern size_t po_filepos_start_line (po_filepos_t filepos); + + +/* ============================ Format type API ============================= */ + +/* Return a NULL terminated array of the supported format types. */ +extern const char * const * po_format_list (void); + +/* Return the pretty name associated with a format type. + For example, for "csharp-format", return "C#". + Return NULL if the argument is not a supported format type. */ +extern const char * po_format_pretty_name (const char *format_type); + + +/* ============================= Checking API ============================== */ + +/* Test whether an entire file PO file is valid, like msgfmt does it. + If it is invalid, pass the reasons to the handler. */ +extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler); + +/* Test a single message, to be inserted in a PO file in memory, like msgfmt + does it. If it is invalid, pass the reasons to the handler. The iterator + is not modified by this call; it only specifies the file and the domain. */ +extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler); + +/* Test whether the message translation is a valid format string if the message + is marked as being a format string. If it is invalid, pass the reasons to + the handler. */ +#define po_message_check_format po_message_check_format_v2 +extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler); + + +#ifdef __cplusplus +} +#endif + +#endif /* _GETTEXT_PO_H */ diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/about.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..b069dea825d3135e6de4dad0f12d547cec9a42f6 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/about.json @@ -0,0 +1,184 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "26.1.0", + "conda_version": "26.1.0", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "gettext", + "final": true, + "parent_recipe": { + "name": "gettext-split", + "path": "/home/task_177204486800161/gettext-feedstock/recipe", + "version": "0.25.1" + }, + "pbp_graph_uuid": "3e8405fd-0d33-4442-9c6e-741a46b5c97d", + "recipe-maintainers": [ + "scopatz", + "ocefpaf", + "pkgw", + "xhochy" + ], + "remote_url": "https://github.com/AnacondaRecipes/gettext-feedstock", + "sha": "4bf3d3ea276e8ac4d8833cf6edee3f440fe7f401", + "task_id": "AU3TsZcCRaK9jiaCosfOMQ", + "task_run_id": "0" + }, + "home": "https://www.gnu.org/software/gettext", + "identifiers": [], + "keywords": [], + "license": "GPL-3.0-or-later", + "license_file": "COPYING", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.12.2 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025b h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.7.1 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "libiconv 1.16 h5eee18b_3", + "pthread-stubs 0.3 h0ce48e5_1", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xorg-libxau 1.0.12 h9b100fa_0", + "xorg-libxdmcp 1.1.5 h9b100fa_0", + "xorg-xorgproto 2024.1 h5eee18b_1", + "xz 5.6.4 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxcb 1.17.0 h9b100fa_0", + "libxml2 2.13.8 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.21.3 h8a1dbc1_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.50.2 hb25bd0a_1", + "xorg-libx11 1.8.12 h9b100fa_1", + "patch 2.8 hb25bd0a_0", + "libmamba 2.0.5 haf1ee3a_1", + "python 3.12.11 h22baa00_0", + "menuinst 2.3.0 py312h06a4308_0", + "anaconda-anon-usage 0.7.1 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 25.0.0 py312h06a4308_0", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 4.3.7 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.19.1 py312h06a4308_0", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.12 py312h5eee18b_0", + "setuptools 78.1.1 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.1 pyhc872135_2", + "ruamel.yaml 0.18.10 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "typing-inspection 0.4.0 py312h06a4308_0", + "brotlicffi 1.0.9.2 py312h6a678d5_1", + "cryptography 45.0.3 py312h2ccb017_0", + "pydantic-core 2.33.2 py312hc6f7160_0", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "pydantic 2.11.7 py312h06a4308_0", + "urllib3 2.5.0 py312h06a4308_0", + "requests 2.32.4 py312h06a4308_0", + "conda-package-streaming 0.12.0 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda-anaconda-tos 0.2.1 py312h06a4308_0", + "libsodium 1.0.20 heac8642_0", + "libunistring 1.3 hb25bd0a_0", + "mbedtls 3.5.1 h6a678d5_1", + "openssl 3.0.18 hd6dcaed_0", + "patchelf 0.17.2 h6a678d5_0", + "perl 5.40.2 0_h5eee18b_perl5", + "yaml 0.2.5 h7b6447c_0", + "liblief 0.16.4 h6a678d5_0", + "gettext 0.21.0 hedfda30_2", + "libidn2 2.3.8 hf80d704_0", + "tk 8.6.15 h54e0aa7_0", + "libcurl 8.16.0 heebcbe5_0", + "git 2.51.0 pl5382h000ed5b_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 25.4.0 py312h06a4308_2", + "certifi 2026.01.04 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_1", + "evalidate 2.0.3 py312h06a4308_0", + "filelock 3.20.3 py312h06a4308_0", + "jmespath 1.1.0 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "msgpack-python 1.1.1 py312h6a678d5_0", + "pkginfo 1.12.1.2 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_1", + "py-lief 0.16.4 py312h6a678d5_0", + "python-libarchive-c 5.3 py312h06a4308_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.28.0 py312h498d7c9_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.3 py312h06a4308_0", + "xmltodict 1.0.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.37.0 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.14.3 py312h06a4308_0", + "jsonschema-specifications 2025.9.1 py312h06a4308_0", + "pynacl 1.6.0 py312h2630517_0", + "jsonschema 4.25.1 py312h06a4308_0", + "botocore 1.42.34 py312h06a4308_0", + "s3transfer 0.16.0 py312h06a4308_0", + "boto3 1.42.34 py312h06a4308_0", + "conda 26.1.0 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.7.0 py312h06a4308_1", + "conda-libmamba-solver 25.11.0 pyhdf14ebd_0", + "conda-build 26.1.0 py312h76456e7_0" + ], + "summary": "library for interfacing programmatically with GNU gettext .po files", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/files b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..04df43328da2c4b044cba5b1f50bfc85381fb9a9 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/files @@ -0,0 +1,2 @@ +include/gettext-po.h +lib/libgettextpo.so diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/git b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/hash_input.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..068dbf7af3f21d8412b86d29b5849b608b49dee4 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/hash_input.json @@ -0,0 +1,12 @@ +{ + "c_stdlib_version": "2.28", + "cxx_compiler_version": "14.3.0", + "channel_targets": "defaults", + "cxx_compiler": "gxx", + "c_compiler_version": "14.3.0", + "libiconv": "1", + "c_stdlib": "sysroot", + "c_compiler": "gcc", + "target_platform": "linux-64", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/index.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..be14287b39c1bda03ec169145bfba0eeb5d922f3 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/index.json @@ -0,0 +1,17 @@ +{ + "arch": "x86_64", + "build": "hf2ab22a_0", + "build_number": 0, + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libgettextpo 0.25.1 hf2ab22a_0", + "libiconv >=1.18,<2.0a0" + ], + "license": "GPL-3.0-or-later", + "name": "libgettextpo-devel", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1772045253856, + "version": "0.25.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/licenses/COPYING b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/licenses/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..e60008693e017bec1b4eb49c84be3898e26fcf2a --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/licenses/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/paths.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..ab23f75ca763beed6d6e221a12b02eb36015dfa5 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/paths.json @@ -0,0 +1,17 @@ +{ + "paths": [ + { + "_path": "include/gettext-po.h", + "path_type": "hardlink", + "sha256": "d3f27edfdf9218be5b36323a09fd7f1ed601a470a9477669e54823b7b070b031", + "size_in_bytes": 15736 + }, + { + "_path": "lib/libgettextpo.so", + "path_type": "softlink", + "sha256": "995efd5ce5775d2b12912aeb485d7c628a3aeb044101b5c3c54f59554cf4feaf", + "size_in_bytes": 466024 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..866fa46f09fba8e319b30a24734242f16b15ff72 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,35 @@ +c_compiler: gcc +c_compiler_version: 14.3.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +cxx_compiler_version: 14.3.0 +extend_keys: +- pin_run_as_build +- extend_keys +- ignore_version +- ignore_build_only_deps +fortran_compiler: gfortran +gettext: '0' +ignore_build_only_deps: +- numpy +- python +libiconv: '1' +lua: '5' +ncurses: '6' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.11' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo-devel.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..c1239bb32ec550050e270853eeac43944d6b9562 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-tools/libgettextpo/gettext-po.h ${PREFIX}/include/gettext-po.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libgettextpo.*.dylib libgettextpo.dylib +else + test -f libgettextpo.so.0 + ln -s libgettextpo.so.0 libgettextpo.so +fi +popd + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/meta.yaml b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..14a280dc78f9359816c952e2b16258b1d12a6796 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/meta.yaml @@ -0,0 +1,75 @@ +# This file created by conda-build 26.1.0 +# ------------------------------------------------ + +package: + name: libgettextpo-devel + version: 0.25.1 +source: + url: https://ftp.gnu.org/pub/gnu/gettext/gettext-0.25.1.tar.xz + sha256: 2c8294be238f03fb3fa65b8051057e5b68167f3e21f08008070cf40a7051ba22 + patches: null +build: + run_exports: + - libgettextpo >=0.25.1,<1.0a0 + ignore_run_exports_from: + - gxx_linux-64 14.3.0.* + number: 0 + string: hf2ab22a_0 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - binutils_impl_linux-64 2.44 h4b9a079_2 + - binutils_linux-64 2.44 hc03a8fd_2 + - gcc_impl_linux-64 14.3.0 h4943218_4 + - gcc_linux-64 14.3.0 hda73cce_12 + - gxx_impl_linux-64 14.3.0 he634eba_4 + - gxx_linux-64 14.3.0 hca8765c_12 + - kernel-headers_linux-64 4.18.0 h3108a97_1 + - ld_impl_linux-64 2.44 h153f514_2 + - libgcc 15.2.0 h69a1729_7 + - libgcc-devel_linux-64 14.3.0 he7458c1_104 + - libgcc-ng 15.2.0 h166f726_7 + - libgomp 15.2.0 h4751f2c_7 + - libltdl 2.6.0 h47b2149_0 + - libsanitizer 14.3.0 hd4faa28_4 + - libstdcxx 15.2.0 h39759b7_7 + - libstdcxx-devel_linux-64 14.3.0 he7458c1_104 + - libtool 2.6.0 h7354ed3_0 + - make 4.2.1 h1bed415_1 + - sysroot_linux-64 2.28 h3108a97_1 + - tzdata 2025c he532380_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - libgcc 15.2.0 h69a1729_7 + - libgettextpo 0.25.1 hf2ab22a_0 + - libgomp 15.2.0 h4751f2c_7 + - libiconv 1.18 h75a1612_0 + run: + - __glibc >=2.28,<3.0.a0 + - libgcc >=14 + - libgettextpo 0.25.1 hf2ab22a_0 + - libiconv >=1.18,<2.0a0 +test: + commands: + - test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT +about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files +extra: + feedstock-name: gettext + recipe-maintainers: + - ocefpaf + - pkgw + - scopatz + - xhochy + final: true + copy_test_source_files: true + remote_url: https://github.com/AnacondaRecipes/gettext-feedstock + sha: 4bf3d3ea276e8ac4d8833cf6edee3f440fe7f401 + task_id: AU3TsZcCRaK9jiaCosfOMQ + task_run_id: '0' + pbp_graph_uuid: 3e8405fd-0d33-4442-9c6e-741a46b5c97d diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..2126fa4a1d6ca54c25a9f0f1403e56d58c72a041 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes @@ -0,0 +1,2 @@ +ar-lib text eol=lf +compile text eol=lf diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/an.po b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/an.po new file mode 100644 index 0000000000000000000000000000000000000000..ea2051bf913a94d6b2839d2cf5bba8a6d9acce56 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/an.po @@ -0,0 +1,145 @@ +# Aragonese translation for glib-networking. +# Copyright (C) 2013 glib-networking's COPYRIGHT HOLDER +# This file is distributed under the same license as the glib-networking package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: glib-networking master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=network\n" +"POT-Creation-Date: 2013-02-19 13:01+0000\n" +"PO-Revision-Date: 2013-02-20 01:19+0100\n" +"Last-Translator: Daniel Martinez \n" +"Language-Team: Aragonese \n" +"Language: an\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../proxy/libproxy/glibproxyresolver.c:150 +msgid "Proxy resolver internal error." +msgstr "Error interna d'o proxy." + +#: ../tls/gnutls/gtlscertificate-gnutls.c:173 +#, c-format +msgid "Could not parse DER certificate: %s" +msgstr "No se podió analisar o certificau DER: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:194 +#, c-format +msgid "Could not parse PEM certificate: %s" +msgstr "No se podió analisar o certificau PEM: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:225 +#, c-format +msgid "Could not parse DER private key: %s" +msgstr "No se podió analisar a clau privada DER: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:256 +#, c-format +msgid "Could not parse PEM private key: %s" +msgstr "No se podió analisar a clau privada PEM: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:296 +msgid "No certificate data provided" +msgstr "No s'han proporcionau datos d'o certificau" + +#: ../tls/gnutls/gtlsclientconnection-gnutls.c:309 +msgid "Server required TLS certificate" +msgstr "O servidor requiere un certificau TLS" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:258 +#, c-format +msgid "Could not create TLS connection: %s" +msgstr "No se podió creyar a connexión TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:520 +msgid "Connection is closed" +msgstr "A connexión ye zarrada" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:582 +#: ../tls/gnutls/gtlsconnection-gnutls.c:1419 +msgid "Operation would block" +msgstr "A operación se blocará" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:712 +msgid "Peer failed to perform TLS handshake" +msgstr "O par falló en realizar a negociación TLS" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:729 +msgid "Peer requested illegal TLS rehandshake" +msgstr "O par solicitó una renegociación TLS ilegal" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:755 +msgid "TLS connection closed unexpectedly" +msgstr "A connexión TLS se zarró inasperadament" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:765 +msgid "TLS connection peer did not send a certificate" +msgstr "O par d'a connexión TLS no ninvió un certificau" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1146 +#: ../tls/gnutls/gtlsconnection-gnutls.c:1165 +#, c-format +msgid "Error performing TLS handshake: %s" +msgstr "Error en realizar a negociación TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1175 +msgid "Server did not return a valid TLS certificate" +msgstr "O servidor no devolvió un certificau TLS valido" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1250 +msgid "Unacceptable TLS certificate" +msgstr "Certificau TLS inacceptable" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1442 +#, c-format +msgid "Error reading data from TLS socket: %s" +msgstr "Error en leyer datos d'o socket TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1471 +#, c-format +msgid "Error writing data to TLS socket: %s" +msgstr "Error en escribir datos en o socket TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1515 +msgid "Connection is already closed" +msgstr "A connexión ya ye zarrada" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1525 +#, c-format +msgid "Error performing TLS close: %s" +msgstr "Error en zarrar o TLS: %s" + +#: ../tls/gnutls/gtlsserverconnection-gnutls.c:103 +msgid "Certificate has no private key" +msgstr "O certificau no tiene clau privada" + +#: ../tls/pkcs11/gpkcs11pin.c:108 +msgid "This is the last chance to enter the PIN correctly before the token is locked." +msgstr "Ista ye a zaguera oportunidat ta introducir o PIN correctament antes que se bloque o \"token\"." + +#: ../tls/pkcs11/gpkcs11pin.c:110 +msgid "Several PIN attempts have been incorrect, and the token will be locked after further failures." +msgstr "Quantos intentos d'introducir o PIN han estau incorrectos y o \"token\" se blocará dimpués de mas fallos." + +#: ../tls/pkcs11/gpkcs11pin.c:112 +msgid "The PIN entered is incorrect." +msgstr "O PIN introduciu ye incorrecto." + +#: ../tls/pkcs11/gpkcs11slot.c:446 +msgid "Module" +msgstr "Modulo" + +#: ../tls/pkcs11/gpkcs11slot.c:447 +msgid "PKCS#11 Module Pointer" +msgstr "Puntero d'o modulo PKCS#11" + +#: ../tls/pkcs11/gpkcs11slot.c:454 +msgid "Slot ID" +msgstr "ID d'a ranura" + +#: ../tls/pkcs11/gpkcs11slot.c:455 +msgid "PKCS#11 Slot Identifier" +msgstr "Identificador d'a ranura de PKCS#11" + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib new file mode 100644 index 0000000000000000000000000000000000000000..54c6bdbf7f1b314721a3af9996f6ed6dd7091619 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib @@ -0,0 +1,275 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2019-07-04.01; # UTC + +# Copyright (C) 2010-2022 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin | msys) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..5c43f5c19c29354b2f3008a53e45dd8b67b49620 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat @@ -0,0 +1,17 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\autosprintf.h %LIBRARY_PREFIX%\include\autosprintf.h +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\.libs\asprintf.dll.lib %LIBRARY_PREFIX%\lib\asprintf.dll.lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-runtime\libasprintf\.libs\asprintf.dll.lib %LIBRARY_PREFIX%\lib\asprintf.lib +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..e790223a2fa1805856d95bcd9bcbb918a3738829 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-runtime/libasprintf/autosprintf.h ${PREFIX}/include/autosprintf.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libasprintf.*.dylib libasprintf.dylib +else + test -f libasprintf.so.0 + ln -s libasprintf.so.0 libasprintf.so +fi +popd + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1a7182a201ae7a6fd580d15be4a359a540ad6fc --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\.libs\asprintf-0.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a0defbb1601d5fdc7859cb3caa40cdfcd0d0623 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-runtime/libasprintf/.libs/libasprintf.*.dylib $PREFIX/lib +else + cp ./gettext-runtime/libasprintf/.libs/libasprintf.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat new file mode 100644 index 0000000000000000000000000000000000000000..d52472e49b7b7fe580071b8d2a6f269f67118e63 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat @@ -0,0 +1,25 @@ +:: Delegate to the Unix script. We need to translate the key path variables +:: to be Unix-y rather than Windows-y, though. + +copy "%RECIPE_DIR%\build.sh" . + +set MSYSTEM=MINGW%ARCH% +set MSYS2_PATH_TYPE=inherit +set CHERE_INVOKING=1 + +set "saved_recipe_dir=%RECIPE_DIR%" +FOR /F "delims=" %%i IN ('cygpath.exe -u -p "%PATH%"') DO set "PATH_OVERRIDE=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%BUILD_PREFIX%"') DO set "BUILD_PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -m "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_M=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_U=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PYTHON%"') DO set "PYTHON=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%RECIPE_DIR%"') DO set "RECIPE_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SP_DIR%"') DO set "SP_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SRC_DIR%"') DO set "SRC_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%STDLIB_DIR%"') DO set "STDLIB_DIR=%%i" + +bash -lxc "${RECIPE_DIR}/install-gettext.sh" +if errorlevel 1 exit 1 +exit 0 + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh new file mode 100644 index 0000000000000000000000000000000000000000..2e5aa8da882754b6dc65ad664b25031c80442991 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euxo pipefail + +make install + +if [[ "${PKG_NAME}" != "gettext" ]]; then + rm -rf ${PREFIX}/share/gettext/projects + rm -rf ${PREFIX}/share/doc/libtextstyle + rm -rf ${PREFIX}/share/doc/gettext/examples + rm -rf ${PREFIX}/share/doc/gettext/javadoc2 +fi + +# This overlaps with readline: +rm -rf ${PREFIX}/share/info/dir + +find $PREFIX -name '*.la' -delete diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..7da0a3cdfad6f437327187d069c6bfc67e06500c --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.bat @@ -0,0 +1,18 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\gettext-po.h %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\.libs\gettextpo.dll.lib %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-tools\libgettextpo\.libs\gettextpo.dll.lib %LIBRARY_PREFIX%\lib\gettextpo.lib +if errorlevel 1 exit 1 + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..c1239bb32ec550050e270853eeac43944d6b9562 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-tools/libgettextpo/gettext-po.h ${PREFIX}/include/gettext-po.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libgettextpo.*.dylib libgettextpo.dylib +else + test -f libgettextpo.so.0 + ln -s libgettextpo.so.0 libgettextpo.so +fi +popd + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat new file mode 100644 index 0000000000000000000000000000000000000000..962a85abda648c4eb9bcbc8581541cdfd550f31d --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-tools\libgettextpo\.libs\gettextpo-0.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh new file mode 100644 index 0000000000000000000000000000000000000000..9e2afdc5569cbbad2164cd670fddfece1d370b9d --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libgettextpo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.*.dylib $PREFIX/lib +else + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..e9bc3fef844f8162ffde23b8be8be837afa4c9e7 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.bat @@ -0,0 +1,17 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\libintl.h %LIBRARY_PREFIX%\include\libintl.h +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\.libs\intl.dll.lib %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-runtime\intl\.libs\intl.dll.lib %LIBRARY_PREFIX%\lib\intl.lib +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..dc72794436c2cc315b6b060b52ffea631257f5cf --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-runtime/intl/libintl.h ${PREFIX}/include/libintl.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libintl.*.dylib libintl.dylib +else + echo "This shouldn't be built on Linux" + exit 1 + # ln -s libintl.so.0 libintl.so +fi +popd diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat new file mode 100644 index 0000000000000000000000000000000000000000..8a582c9db8eab8082a0cfb1fe1600e434aa3d0a3 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-runtime\intl\.libs\intl-8.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh new file mode 100644 index 0000000000000000000000000000000000000000..864f86a3dd570c9d897fb92ec9d8d8f6dbe47d4f --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/install-libintl.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-runtime/intl/.libs/libintl.*.dylib $PREFIX/lib +else + cp ./gettext-runtime/intl/.libs/libintl.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d31928cef7d7580f39bf191f7921ca3fd83401ca --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/meta.yaml @@ -0,0 +1,449 @@ +{% set version = "0.25.1" %} +{% set am_version = "1.15" %} # keep synchronized with build.sh +{% set posix = 'm2-' if win else '' %} +{% set native = 'm2w64-' if win else '' %} + +# Note: as of 0.23.1, we have given up on trying to build gettext on Windows +# with MSVC -- there are new patterns that may make it simply impossible due to +# the ways that some DLL-exported variables are used. See discussion in #35. It +# *is* possible to build gettext on Windows using MinGW/GCC -- see #34. But for +# now we would rather turn off the Windows build than undertake the major +# migration that a switch to GCC would entail. +# +# For the time being, we're not stripping out the Windows build files and +# configuration from this recipe, but they're not being used. + +package: + name: gettext-split + version: {{ version }} + +source: + url: https://ftp.gnu.org/pub/gnu/gettext/gettext-{{ version }}.tar.xz + sha256: 2c8294be238f03fb3fa65b8051057e5b68167f3e21f08008070cf40a7051ba22 + patches: + - patches/0001-Mark-v-snprintf-as-available.patch # [win] + - patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch # [win] + - patches/0003-Fix-some-DLL-export-markings-in-libintl.patch # [win] + - patches/0004-Fix-quoting-when-invoking-windres.patch # [win] + - patches/0005-CXXLD-is-not-a-thing.patch # [win] + - patches/0006-Work-around-Unixisms-in-libgettextpo.patch # [win] + - patches/0007-Add-missing-extern-C-protectors.patch # [win] + - patches/0008-Declaration-ordering.patch # [win] + +build: + number: 0 + skip: true # [win] + +requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - make # [unix] + host: + - libiconv {{ libiconv }} + - ncurses {{ ncurses }} # [not win] + +outputs: + - name: libintl + build: + skip: true # [linux] + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libintl.sh # [unix] + script: install-libintl.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libintl.*.dylib # [osx] + - test -f ${PREFIX}/lib/libintl.so.* # [linux] + - if not exist %PREFIX%\Library\bin\intl-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libintl$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/include/libintl.h # [osx] + - if exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\intl.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\include\libintl.h exit /b1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: library that provides native language support to programs + + - name: libintl-devel + build: + skip: true # [linux] + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libintl-devel.sh # [unix] + script: install-libintl-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('libintl', exact=true) }} + run: + - {{ pin_subpackage('libintl', exact=true) }} + test: + commands: + - test -f ${PREFIX}/lib/libintl${SHLIB_EXT} # [osx] + - test -f ${PREFIX}/include/libintl.h # [osx] + - if not exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\intl.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\include\libintl.h exit /b1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: library that provides native language support to programs + + - name: libasprintf + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libasprintf') }} + ignore_run_exports: + - libiconv + script: install-asprintf.sh # [unix] + script: install-asprintf.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libasprintf.*.dylib # [osx] + - test -f ${PREFIX}/lib/libasprintf.so.0 # [linux] + - if not exist %PREFIX%\Library\bin\asprintf-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libasprintf$SHLIB_EXT # [not win] + - if exist %PREFIX%\Library\lib\asprintf.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\asprintf.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: C-style formatted output in C++ + + - name: libasprintf-devel + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libasprintf') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + ignore_run_exports: + - libiconv + script: install-asprintf-devel.sh # [unix] + script: install-asprintf-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('libasprintf', exact=True) }} + run: + - {{ pin_subpackage('libasprintf', exact=True) }} + test: + commands: + - test -f ${PREFIX}/lib/libasprintf${SHLIB_EXT} # [not win] + - if not exist %PREFIX%\Library\lib\asprintf.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\asprintf.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later + license_file: COPYING + summary: Decomposed printf argument list + + - name: libgettextpo + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libgettextpo') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libgettextpo.sh # [unix] + script: install-libgettextpo.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - libiconv {{ libiconv }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + test: + commands: + # Only the actual binary (versioned) variant should be in this package + - test -f ${PREFIX}/lib/libgettextpo.*.dylib # [osx] + - test -f ${PREFIX}/lib/libgettextpo.so.0 # [linux] + - if not exist %PREFIX%\Library\bin\gettextpo-*.dll exit /b 1 # [win] + # The unversioned variants as well as the lib on Windows should be in the main gettext package. + - test ! -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - if exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if exist %PREFIX%\Library\lib\gettextpo.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files + + - name: libgettextpo-devel + build: + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libgettextpo') }} + ignore_run_exports_from: + - {{ compiler('cxx') }} # [unix] + script: install-libgettextpo-devel.sh # [unix] + script: install-libgettextpo-devel.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libgettextpo', exact=True) }} + - libiconv {{ libiconv }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libgettextpo', exact=True) }} + test: + commands: + - test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - if not exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\lib\gettextpo.lib exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files + + - name: gettext-tools + script: install-gettext.sh # [unix] + script: install-gettext.bat # [not unix] + build: + ignore_run_exports_from: + - {{ compiler('cxx') }} + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - make # [unix] + host: + - libiconv {{ libiconv }} + - ncurses {{ ncurses }} # [not win] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + # Devel packages are included for deduplication-purposes only + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + run: + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + test: + files: + - an.po + requires: + - ncurses {{ ncurses }} # [not win] + commands: + - msgfmt.exe --help # [win] + - msgfmt.exe -o an.gmo an.po # [win] + - msgfmt -o an.gmo an.po # [not win] + about: + home: https://www.gnu.org/software/gettext + # The binaries of gettext are the GPL-3.0 licensed part. + license: GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package (executable tools) + + - name: gettext + build: + # Required to make overdepending checks pass. + ignore_run_exports: + - libintl + - libasprintf + - libgettextpo + run_exports: + # Seems pretty good: https://abi-laboratory.pro/tracker/timeline/gettext + - {{ pin_subpackage('libintl') }} # [not linux] + - {{ pin_subpackage('libasprintf') }} + - {{ pin_subpackage('libgettextpo') }} + script: install-gettext.sh # [unix] + script: install-gettext.bat # [not unix] + requirements: + build: + - posix # [win] + - {{ posix }}autoconf # [win] + - {{ posix }}automake{{ am_version }} # [win] + - {{ posix }}libtool + - {{ posix }}patch # [win] + - {{ posix }}sed # [win] + - {{ native }}binutils # [win] + - {{ native }}crt-git # [win] + - {{ stdlib('c') }} # [not win] + - {{ compiler('c') }} # [not win] + - {{ compiler('cxx') }} # [not win] + - make # [unix] + host: + - libiconv {{ libiconv }} + - {{ pin_subpackage('gettext-tools', exact=True) }} + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + run: + - {{ pin_subpackage('gettext-tools', exact=True) }} + - {{ pin_subpackage('libintl-devel', exact=True) }} # [not linux] + - {{ pin_subpackage('libintl', exact=True) }} # [not linux] + - {{ pin_subpackage('libasprintf-devel', exact=True ) }} + - {{ pin_subpackage('libasprintf', exact=True ) }} + - {{ pin_subpackage('libgettextpo-devel', exact=True ) }} + - {{ pin_subpackage('libgettextpo', exact=True ) }} + test: + commands: + # ===== gettextlib ===== + - test -f ${PREFIX}/lib/libgettextlib$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextlib.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextlib.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextlib-*.dll exit /b 1 # [win] + # ===== gettextpo ===== + - test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextpo.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextpo.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextpo-*.dll exit /b 1 # [win] + # ===== gettextsrc ===== + - test -f ${PREFIX}/lib/libgettextsrc$SHLIB_EXT # [not win] + - test ! -f ${PREFIX}/lib/libgettextsrc.a # [not win] + - if not exist %PREFIX%\Library\lib\gettextsrc.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\gettextsrc-*.dll exit /b 1 # [win] + # ===== intl (not on linux) ===== + - test -f ${PREFIX}/lib/libintl$SHLIB_EXT # [not win and not linux] + - test ! -f ${PREFIX}/lib/libintl.a # [not win and not linux] + - if not exist %PREFIX%\Library\lib\intl.dll.lib exit /b 1 # [win] + - if not exist %PREFIX%\Library\bin\intl-*.dll exit /b 1 # [win] + about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later AND GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package + +about: + home: https://www.gnu.org/software/gettext + license: LGPL-2.1-or-later AND GPL-3.0-or-later + license_file: COPYING + summary: Internationalization package + description: | + gettext utilities are a set of tools that provides a framework to help + other GNU packages produce multi-lingual messages. These tools include + a set of conventions about how programs should be written to support message + catalogs, a directory and file naming organization for the message catalogs themselves + dev_url: https://www.gnu.org/software/gettext + doc_url: https://www.gnu.org/software/gettext/manual + +extra: + feedstock-name: gettext + recipe-maintainers: + - scopatz + - ocefpaf + - pkgw + - xhochy diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh new file mode 100644 index 0000000000000000000000000000000000000000..397e2e76a9dee4c89a2f4d51c8a74d7e5b8de44e --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/msvcpp.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Needed because "windres" can't handle a preprocesser whose invocation is +# more than one word. +exec cl -nologo -E -DRC_INVOKED "$@" diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch new file mode 100644 index 0000000000000000000000000000000000000000..c956670a1931c785b1c504d4e67cb7b5c8e2cd9a --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0001-Mark-v-snprintf-as-available.patch @@ -0,0 +1,84 @@ +From 4fa8feff0af88fb3c7dd3fceb722dabe48b6dfa0 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:28:40 -0400 +Subject: [PATCH 1/8] Mark (v)snprintf as available + +`configure` checks whether `snprintf` is available by attempting to link with +it. Windows didn't used to provide it at all. However, newer Windows does +provide it, but as an inline C implementation, so direct linking doesn't work. +For our purposes, the inline implementation is equivalent to a libc that +provides the functions, so hack our configure scripts to mark these functions +as available. +--- + configure.ac | 2 ++ + gettext-runtime/configure.ac | 2 ++ + gettext-runtime/libasprintf/configure.ac | 2 ++ + gettext-tools/configure.ac | 2 ++ + gettext-tools/examples/configure.ac | 2 ++ + 5 files changed, 10 insertions(+) + +diff --git a/configure.ac b/configure.ac +index f4e54ea..ef64e67 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c]) + AC_CONFIG_AUX_DIR([build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar]) + + dnl Override automake's tar command used for creating distributions. +diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac +index 126d069..66f26fa 100644 +--- a/gettext-runtime/configure.ac ++++ b/gettext-runtime/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-runtime], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([intl/dcigettext.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac +index 2fe76cf..31a06db 100644 +--- a/gettext-runtime/libasprintf/configure.ac ++++ b/gettext-runtime/libasprintf/configure.ac +@@ -20,6 +20,8 @@ AC_PREREQ([2.64]) + AC_INIT([libasprintf], [1.0]) + AC_CONFIG_SRCDIR([vasprintf.c]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index 3610ee3..6c75ccc 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-tools], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([src/msgfmt.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) + AC_CONFIG_HEADERS([config.h]) + +diff --git a/gettext-tools/examples/configure.ac b/gettext-tools/examples/configure.ac +index 249fd14..4db994e 100644 +--- a/gettext-tools/examples/configure.ac ++++ b/gettext-tools/examples/configure.ac +@@ -22,6 +22,8 @@ AC_INIT([gettext-examples], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([installpaths.in]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++ac_cv_func_snprintf=yes ++ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) + + dnl Installation directories. diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch new file mode 100644 index 0000000000000000000000000000000000000000..11fa4a51862263fe4b5370e4cc6a0d9551f8c9ef --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0002-Prevent-libtool-from-worrying-about-dependent-librar.patch @@ -0,0 +1,79 @@ +From e11f7bc727a6a3029c2f5b8f3002cd70817b2a8c Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:32:14 -0400 +Subject: [PATCH 2/8] Prevent libtool from worrying about dependent libraries + too much. + +Dependent libraries on Windows can take on a lot of names, depending on how +packagers mix and match "lib" prefixes, ".lib" vs. ".a" suffixes, and so on. +Libtool isn't great at guessing them. By hacking cache variables in the +`configure.ac` scripts, we can force it to just go ahead and pass everything +and not worry about it. +--- + configure.ac | 1 + + gettext-runtime/configure.ac | 1 + + gettext-runtime/libasprintf/configure.ac | 1 + + gettext-tools/configure.ac | 1 + + gettext-tools/examples/configure.ac | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index ef64e67..05a7d18 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c]) + AC_CONFIG_AUX_DIR([build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar]) +diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac +index 66f26fa..7e914f8 100644 +--- a/gettext-runtime/configure.ac ++++ b/gettext-runtime/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-runtime], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([intl/dcigettext.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) +diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac +index 31a06db..3a89c61 100644 +--- a/gettext-runtime/libasprintf/configure.ac ++++ b/gettext-runtime/libasprintf/configure.ac +@@ -20,6 +20,7 @@ AC_PREREQ([2.64]) + AC_INIT([libasprintf], [1.0]) + AC_CONFIG_SRCDIR([vasprintf.c]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index 6c75ccc..fa01857 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-tools], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([src/msgfmt.c]) + AC_CONFIG_AUX_DIR([../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) +diff --git a/gettext-tools/examples/configure.ac b/gettext-tools/examples/configure.ac +index 4db994e..6a59715 100644 +--- a/gettext-tools/examples/configure.ac ++++ b/gettext-tools/examples/configure.ac +@@ -22,6 +22,7 @@ AC_INIT([gettext-examples], + [bug-gettext@gnu.org]) + AC_CONFIG_SRCDIR([installpaths.in]) + AC_CONFIG_AUX_DIR([../../build-aux]) ++lt_cv_deplibs_check_method=pass_all + ac_cv_func_snprintf=yes + ac_cv_func_vsnprintf=yes + AM_INIT_AUTOMAKE([silent-rules]) diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch new file mode 100644 index 0000000000000000000000000000000000000000..732eccd29ebdd82ac3252525b0e8f617d66090d2 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0003-Fix-some-DLL-export-markings-in-libintl.patch @@ -0,0 +1,110 @@ +From d7490b79ce621dc4d859c1a82712f2ffe7366593 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:34:54 -0400 +Subject: [PATCH 3/8] Fix some DLL export markings in libintl. + +A few files had inconsistent labeling for DLL exporting, which I guess MSVC +might be pickier about than it used to be. Tidy them up. +--- + gettext-runtime/gnulib-lib/relocatable.c | 2 +- + gettext-runtime/intl/libgnuintl.in.h | 15 ++++++++++++--- + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/gettext-runtime/gnulib-lib/relocatable.c b/gettext-runtime/gnulib-lib/relocatable.c +index 365c085..5f7fad6 100644 +--- a/gettext-runtime/gnulib-lib/relocatable.c ++++ b/gettext-runtime/gnulib-lib/relocatable.c +@@ -164,7 +164,7 @@ set_this_relocation_prefix (const char *orig_prefix_arg, + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +-void ++RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) + { + set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h +index ae81ffe..487675d 100644 +--- a/gettext-runtime/intl/libgnuintl.in.h ++++ b/gettext-runtime/intl/libgnuintl.in.h +@@ -48,6 +48,15 @@ + # undef gettext + #endif + ++ ++#if HAVE_VISIBILITY && BUILDING_DLL ++# define DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_DLL ++# define DLL_EXPORTED __declspec(dllexport) ++#else ++# define DLL_EXPORTED ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -1095,7 +1104,7 @@ char *setlocale (int __category, const char *__locale) + # undef setlocale + # define setlocale libintl_setlocale + # endif +-extern char *setlocale (int, const char *) ++extern DLL_EXPORTED char *setlocale (int, const char *) + _INTL_ASM (libintl_setlocale); + # if defined _INTL_REDIRECT_MACROS && defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE + namespace std { using ::libintl_setlocale; } +@@ -1123,7 +1132,7 @@ locale_t newlocale (int __category_mask, const char *__name, locale_t __base) + # undef newlocale + # define newlocale libintl_newlocale + # endif +-extern locale_t newlocale (int, const char *, locale_t) ++extern DLL_EXPORTED locale_t newlocale (int, const char *, locale_t) + _INTL_ASM (libintl_newlocale); + # if defined _INTL_REDIRECT_MACROS && defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE + namespace std { using ::libintl_newlocale; } +@@ -1144,7 +1153,7 @@ namespace std { using ::libintl_newlocale; } + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ + #define libintl_set_relocation_prefix libintl_set_relocation_prefix +-extern void ++extern DLL_EXPORTED void + libintl_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index dcbf1d7..47b0a1c 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -392,8 +392,12 @@ AH_BOTTOM([ + the C macro DLL_EXPORT (together with PIC) when compiling for a shared + library (called DLL under Windows) and does not define it when compiling + an object file meant to be linked statically into some executable. */ +-#if (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER +-# define DLL_VARIABLE __declspec (dllimport) ++#if (defined _WIN32 || defined __CYGWIN__) && !defined IN_RELOCWRAPPER ++# if defined DLL_EXPORT ++# define DLL_VARIABLE __declspec (dllexport) ++# else ++# define DLL_VARIABLE __declspec (dllimport) ++# endif + #else + # define DLL_VARIABLE + #endif +diff --git a/gettext-runtime/intl/configure.ac b/gettext-runtime/intl/configure.ac +index 749a700..a74c122 100755 +--- a/gettext-runtime/intl/configure.ac ++++ b/gettext-runtime/intl/configure.ac +@@ -235,8 +235,12 @@ AH_BOTTOM([ + the C macro DLL_EXPORT (together with PIC) when compiling for a shared + library (called DLL under Windows) and does not define it when compiling + an object file meant to be linked statically into some executable. */ +-#if (defined _MSC_VER && defined DLL_EXPORT) && !defined IN_RELOCWRAPPER +-# define DLL_VARIABLE __declspec (dllimport) ++#if defined _MSC_VER && !defined IN_RELOCWRAPPER ++# if defined DLL_EXPORT ++# define DLL_VARIABLE __declspec (dllexport) ++# else ++# define DLL_VARIABLE __declspec (dllimport) ++# endif + #else + # define DLL_VARIABLE + #endif diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch new file mode 100644 index 0000000000000000000000000000000000000000..5318fefa1d760dd5016bad98c2693d27d67230ac --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0004-Fix-quoting-when-invoking-windres.patch @@ -0,0 +1,120 @@ +From 62972ab62dd216ef95df90187487d14bc86e5def Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:36:09 -0400 +Subject: [PATCH 4/8] Fix quoting when invoking "windres" + +Version strings were being quoted too much. I'm not sure why this wasn't a +problem elsewhere, but it's definitely a problem on Windows. +--- + gettext-runtime/intl/Makefile.am | 2 +- + gettext-runtime/libasprintf/Makefile.am | 2 +- + gettext-runtime/src/Makefile.am | 2 +- + gettext-tools/libgettextpo/Makefile.am | 2 +- + gettext-tools/src/Makefile.am | 2 +- + libtextstyle/lib/Makefile.am | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am +index 2bed67b..ae4123e 100644 +--- a/gettext-runtime/intl/Makefile.am ++++ b/gettext-runtime/intl/Makefile.am +@@ -411,7 +411,7 @@ libintl.res.lo: $(srcdir)/libintl.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-runtime/libasprintf/Makefile.am b/gettext-runtime/libasprintf/Makefile.am +index c0eb406..4ca6b0a 100644 +--- a/gettext-runtime/libasprintf/Makefile.am ++++ b/gettext-runtime/libasprintf/Makefile.am +@@ -99,7 +99,7 @@ libasprintf.res.lo: $(srcdir)/libasprintf.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-runtime/src/Makefile.am b/gettext-runtime/src/Makefile.am +index e9974c4..9da1c7b 100644 +--- a/gettext-runtime/src/Makefile.am ++++ b/gettext-runtime/src/Makefile.am +@@ -70,7 +70,7 @@ RELOCATABLE_STRIP = : + if WOE32 + WOE32_LDADD = gettext.res + gettext.res : $(top_srcdir)/../windows/gettext.rc +- $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff ++ $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff + MOSTLYCLEANFILES += gettext.res + else + WOE32_LDADD = +diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am +index 5fc6708..98d65cc 100644 +--- a/gettext-tools/libgettextpo/Makefile.am ++++ b/gettext-tools/libgettextpo/Makefile.am +@@ -146,7 +146,7 @@ EXTRA_DIST += libgettextpo.rc + if WOE32 + WOE32_LIBADD = libgettextpo.res.lo + libgettextpo.res.lo : $(srcdir)/libgettextpo.rc +- $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff ++ $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff + MOSTLYCLEANFILES += libgettextpo.res.lo + else + WOE32_LIBADD = +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index f77129d..0f77ee8 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -756,7 +756,7 @@ RELOCATABLE_STRIP = : + if WOE32 + WOE32_LDADD = gettext.res + gettext.res : $(top_srcdir)/../windows/gettext.rc +- $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff ++ $(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff + MOSTLYCLEANFILES += gettext.res + else + WOE32_LDADD = +diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am +index bf4b408..59810c1 100644 +--- a/libtextstyle/lib/Makefile.am ++++ b/libtextstyle/lib/Makefile.am +@@ -268,7 +268,7 @@ libtextstyle.res.lo: $(srcdir)/libtextstyle.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-tools/gnulib-lib/Makefile.am_orig b/gettext-tools/gnulib-lib/Makefile.am +index a7e7d88..7dc2e6b 100644 +--- a/gettext-tools/gnulib-lib/Makefile.am_orig ++++ b/gettext-tools/gnulib-lib/Makefile.am +@@ -76,7 +76,7 @@ libgettextlib.res.lo: $(srcdir)/libgettextlib.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 607dcf0..23231cb 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -372,7 +372,7 @@ libgettextsrc.res.lo: $(srcdir)/libgettextsrc.rc + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ +- "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ ++ "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch new file mode 100644 index 0000000000000000000000000000000000000000..0fe985162a8a225bd6c953411748c6bdd3bbcbf5 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0005-CXXLD-is-not-a-thing.patch @@ -0,0 +1,88 @@ +From 8538d082c870ef99bccb8c48acc0c40e525c07cb Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:37:12 -0400 +Subject: [PATCH 5/8] CXXLD is not a thing. + +Maybe it was at some point? But it isn't now. CCLD works fine on Windows since +CC and CXX (the C and C++ compilers) are the same thing. +--- + gettext-tools/gnulib-lib/Makefile.am | 2 +- + gettext-tools/src/Makefile.am | 22 +++++++++++----------- + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/gettext-tools/gnulib-lib/Makefile.am b/gettext-tools/gnulib-lib/Makefile.am +index a7fa494..a7e7d88 100644 +--- a/gettext-tools/gnulib-lib/Makefile.am ++++ b/gettext-tools/gnulib-lib/Makefile.am +@@ -111,7 +111,7 @@ libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + else + libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \ + -o $@ + # Use the same definition of CXXLD as Automake generates in other Makefiles. + CXXLD = $(CXX) +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 036ec64..607dcf0 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -552,47 +552,47 @@ xgettext_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + else + libgettextsrc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextsrc_la_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(libgettextsrc_la_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgattrib_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgattrib_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgattrib_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgcat_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcat_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcat_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgcomm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcomm_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgcomm_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgconv_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgconv_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgconv_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgen_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgen_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgfilter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgfilter_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msgfilter_LDFLAGS) $(LDFLAGS) \ + -o $@ + msggrep_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msggrep_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msggrep_LDFLAGS) $(LDFLAGS) \ + -o $@ + msgmerge_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(msgmerge_CXXFLAGS) $(CXXFLAGS) $(msgmerge_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(msgmerge_CXXFLAGS) $(CXXFLAGS) $(msgmerge_LDFLAGS) $(LDFLAGS) \ + -o $@ + msguniq_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msguniq_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(msguniq_LDFLAGS) $(LDFLAGS) \ + -o $@ + xgettext_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ +- $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(xgettext_LDFLAGS) $(LDFLAGS) \ ++ $(CCLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(xgettext_LDFLAGS) $(LDFLAGS) \ + -o $@ + endif + diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch new file mode 100644 index 0000000000000000000000000000000000000000..1fae592458d921cf736ba4d89bf5d8349ceb9241 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0006-Work-around-Unixisms-in-libgettextpo.patch @@ -0,0 +1,40 @@ +From cf1eb94eb581d73c3079a71955f5d2d9a307a5ca Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:39:00 -0400 +Subject: [PATCH 6/8] Work around Unixisms in libgettextpo + +There's a complicated bit of shell magic here that relies on redirecting +program output to file descriptor #5. That seems not to work on Windows. Just +use a temporary file instead. +--- + gettext-tools/libgettextpo/Makefile.am | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am +index 98d65cc..9cfb6ce 100644 +--- a/gettext-tools/libgettextpo/Makefile.am ++++ b/gettext-tools/libgettextpo/Makefile.am +@@ -174,7 +174,7 @@ config.h: $(BUILT_SOURCES) + echo '#endif /* GTPO_CONFIG_H */'; \ + } > config.h && \ + if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \ +- { \ ++ { rm -f CONFIG_H_LISTING.txt; \ + for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \ + case $$f in \ + *.c | *.$(OBJEXT) | *.lo ) \ +@@ -182,12 +182,12 @@ config.h: $(BUILT_SOURCES) + test -f $$sf || sf=$(srcdir)/$$sf; \ + of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \ + $(COMPILE) $(DEFS) $(GL_CFLAG_INHIBIT_WARNINGS) -c $$sf || { rm -f config.h; exit 1; }; \ +- sh ./exported.sh $$of 1>&5; \ ++ sh ./exported.sh $$of >>CONFIG_H_LISTING.txt; \ + rm -f $$of `echo "$$of" | sed -e 's,\\.$(OBJEXT)$$,.lo,'`; \ + ;; \ + esac; \ + done; \ +- } 5>&1 1>&2 \ ++ }; cat CONFIG_H_LISTING.txt \ + | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \ + | sed -e 's,^obstack_free$$,__obstack_free,' \ + | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \ diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch new file mode 100644 index 0000000000000000000000000000000000000000..68136ea8c5fe43f36403968dbae865e66ec028b3 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0007-Add-missing-extern-C-protectors.patch @@ -0,0 +1,40 @@ +From 7c58479500f1caf6085662ead8702cf06127deb0 Mon Sep 17 00:00:00 2001 +From: Peter Williams +Date: Mon, 3 Sep 2018 17:54:36 -0400 +Subject: [PATCH 7/8] Add missing 'extern "C"' protectors + +Various files are missing 'extern "C"' blocks around C declarations. + +The context here is that on Windows, some files are compiled as C++ code even +though they're written as pretty much straight C. The motivation seems to be +that MSVC doesn't fully support C99 or C11, specifically non-constant +initializers. But C++ allows this, so the code will come out fine if compiled +as C++. However, without proper 'extern "C"' protection, you get linkage +errors. +--- + gettext-tools/src/plural-table.h | 8 ++++++++ + +diff --git a/gettext-tools/src/plural-table.h b/gettext-tools/src/plural-table.h +index e6c52bb..d736ef0 100644 +--- a/gettext-tools/src/plural-table.h ++++ b/gettext-tools/src/plural-table.h +@@ -20,6 +20,10 @@ + + #include + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + struct plural_table_entry + { + const char *lang; +@@ -30,4 +34,8 @@ struct plural_table_entry + extern DLL_VARIABLE struct plural_table_entry plural_table[]; + extern DLL_VARIABLE const size_t plural_table_size; + ++#ifdef __cplusplus ++} ++#endif ++ + #endif /* _PLURAL_TABLE_H */ diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch new file mode 100644 index 0000000000000000000000000000000000000000..284901d912736be394ca5a676ce19ef206839758 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/recipe/parent/patches/0008-Declaration-ordering.patch @@ -0,0 +1,21 @@ +In gettext-tools, both `libgrep` and `gnulib-lib` provide their own versions of +headers like `stdlib.h`, but the two variants aren't the same. Some of the tools +want to use `unsetenv()` as provided by gnulib-lib, but the default include flag +ordering puts libgrep first, which doesn't define it. This is all pretty messy +but the most expedient thing is to reorder the includes to get the gnulib-lib +version first. + +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 607dcf0..c641919 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -109,8 +109,8 @@ schemadir = $(pkgdatadir)/schema + # The option -I$(top_srcdir) is needed so that woe32dll/export.h is found. + AM_CPPFLAGS = \ + -I$(top_srcdir) \ +- -I../libgrep -I$(top_srcdir)/libgrep \ + -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ ++ -I../libgrep -I$(top_srcdir)/libgrep \ + -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl + DEFS = \ + -DLOCALEDIR=$(localedir_c_make) \ diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/repodata_record.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..0867b9fbd7d83ec8bbebaf8fbd2edd1f788188a0 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/repodata_record.json @@ -0,0 +1,24 @@ +{ + "arch": "x86_64", + "build": "hf2ab22a_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libgettextpo 0.25.1 hf2ab22a_0", + "libiconv >=1.18,<2.0a0" + ], + "fn": "libgettextpo-devel-0.25.1-hf2ab22a_0.conda", + "license": "GPL-3.0-or-later", + "md5": "5766eead346251db288d5b13c3dffd6f", + "name": "libgettextpo-devel", + "platform": "linux", + "sha256": "dcf5a9cf369a65a01367967177721b943a2927fa4305c4b4d04d80764d943f8c", + "size": 36248, + "subdir": "linux-64", + "timestamp": 1772045253000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libgettextpo-devel-0.25.1-hf2ab22a_0.conda", + "version": "0.25.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/run_exports.json b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..f4b5ce9701221dfa31b5f7bb10a5d400c68af6e8 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libgettextpo >=0.25.1,<1.0a0"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/test/run_test.sh b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..98f37290c626fa010c308e99a18412a994a6723f --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-devel-0.25.1-hf2ab22a_0/info/test/run_test.sh @@ -0,0 +1,8 @@ + + +set -ex + + + +test -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT +exit 0 diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/about.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..7f447564e012a9bf1548aef41573ee14e27f73a4 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/about.json @@ -0,0 +1,164 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "ctng-compilers-feedstock", + "final": true, + "parent_recipe": { + "name": "gcc_compilers", + "path": "/home/task_176276935360828/ctng-compilers-feedstock/recipe", + "version": "15.2.0" + }, + "recipe-maintainers": [ + "timsnyder", + "xhochy", + "isuruf", + "beckermr" + ] + }, + "home": "https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html", + "identifiers": [], + "keywords": [], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "The GCC OpenMP implementation.", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/files b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/files new file mode 100644 index 0000000000000000000000000000000000000000..386195c58df6cb44c4343b2f6cb8aa06c666f81e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/files @@ -0,0 +1,3 @@ +lib/libgomp.so +lib/libgomp.so.1.0.0 +share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/git b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/hash_input.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..01e107e7674b3f525561f742ecdcbff61d2f93ff --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/hash_input.json @@ -0,0 +1,11 @@ +{ + "cross_target_stdlib": "sysroot", + "libgomp_ver": "1.0.0", + "cross_target_stdlib_version": "2.28", + "target_platform": "linux-64", + "cross_target_platform": "linux-64", + "platform": "linux-64", + "triplet": "x86_64-conda-linux-gnu", + "channel_targets": "defaults", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/index.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..7f57eff1ec04089ea23a5a8bea0be2b44613aba9 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/index.json @@ -0,0 +1,14 @@ +{ + "arch": "x86_64", + "build": "h4751f2c_7", + "build_number": 7, + "depends": [ + "__glibc >=2.28,<3.0.a0" + ], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "name": "libgomp", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1762772542830, + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/paths.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..76075cdb22ef189ce1067a4d109d97ffb8f38d37 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/paths.json @@ -0,0 +1,23 @@ +{ + "paths": [ + { + "_path": "lib/libgomp.so", + "path_type": "softlink", + "sha256": "9695a4d9ff838726ec403c5eab52840cc5737da18905f72f5ce094cc805eb036", + "size_in_bytes": 1169384 + }, + { + "_path": "lib/libgomp.so.1.0.0", + "path_type": "hardlink", + "sha256": "9695a4d9ff838726ec403c5eab52840cc5737da18905f72f5ce094cc805eb036", + "size_in_bytes": 1169384 + }, + { + "_path": "share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy", + "path_type": "hardlink", + "sha256": "9d6b43ce4d8de0c878bf16b54d8e7a10d9bd42b75178153e3af6a815bdc90f74", + "size_in_bytes": 3324 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6de73da57e6bc8ce414772f2c7a838d2e377b584 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/conda_build_config.yaml @@ -0,0 +1,42 @@ +binutils_version: '2.44' +c_compiler: gcc +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_sources: conda-forge/label/sysroot-with-crypt,conda-forge +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cross_target_platform: linux-64 +cross_target_stdlib: sysroot +cross_target_stdlib_version: '2.28' +cxx_compiler: gxx +extend_keys: +- extend_keys +- ignore_version +- pin_run_as_build +- ignore_build_only_deps +fortran_compiler: gfortran +gcc_maj_ver: '15' +gcc_version: 15.2.0 +ignore_build_only_deps: +- python +- numpy +libgfortran_soname: '5' +libgomp_ver: 1.0.0 +lua: '5' +numpy: '1.26' +openmp_ver: '4.5' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 +triplet: x86_64-conda-linux-gnu +with_conda_specs: 'true' diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/install-libgomp.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/install-libgomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..cdd189f59dd81af7df42846c40b9300bf64dcd1e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/install-libgomp.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +cd build + +make -C ${triplet}/libgomp prefix=${PREFIX} install-toolexeclibLTLIBRARIES +rm ${PREFIX}/lib/libgomp.a ${PREFIX}/lib/libgomp.la + +if [[ "$target_platform" == "linux-"* ]]; then + rm ${PREFIX}/lib/libgomp.so.1 + rm ${PREFIX}/lib/libgomp.so + ln -sf ${PREFIX}/lib/libgomp.so.${libgomp_ver} ${PREFIX}/lib/libgomp.so +else + rm ${PREFIX}/lib/libgomp.dll.a +fi + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/meta.yaml b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c09a3c3776f36042cd76e831ceec3cf6e064c5c2 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/meta.yaml @@ -0,0 +1,51 @@ +# This file created by conda-build 25.1.2 +# ------------------------------------------------ + +package: + name: libgomp + version: 15.2.0 +source: + - patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 + url: + - https://ftp.gnu.org/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz +build: + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - '*' + number: 7 + run_exports: + strong: + - _openmp_mutex >=4.5 + string: h4751f2c_7 +requirements: + host: + - kernel-headers_linux-64 4.18.0 h528b178_0 + - sysroot_linux-64 2.28 h528b178_0 + - tzdata 2025b h04d1e81_0 + run: + - __glibc >=2.28,<3.0.a0 +test: + commands: + - test -f ${PREFIX}/lib/libgomp.so.1.0.0 + - test ! -f ${PREFIX}/lib/libgomp.so.1 + requires: + - sysroot_linux-64 +about: + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + summary: The GCC OpenMP implementation. +extra: + copy_test_source_files: true + feedstock-name: ctng-compilers-feedstock + final: true + recipe-maintainers: + - beckermr + - isuruf + - timsnyder + - xhochy diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/LICENSE b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cba42cffc2901212c539e558950c6f6ed985d628 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/LICENSE @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2019, conda-forge +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. Neither the name of the copyright holder 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. diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/build.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..68e45267b8eceabd79595abe9d20ddbc89939d23 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/build.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +set -ex + +source ${RECIPE_DIR}/setup_compiler.sh + +# ensure patch is applied +grep 'conda-forge:: allow' gcc/gcc.c* + +GCC_CONFIGURE_OPTIONS=() + +if [[ "$channel_targets" == *conda-forge* ]]; then + GCC_CONFIGURE_OPTIONS+=(--with-pkgversion="conda-forge gcc ${gcc_version}-${PKG_BUILDNUM}") + GCC_CONFIGURE_OPTIONS+=(--with-bugurl="https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose") +fi + +for tool in addr2line ar as c++filt cc c++ fc gcc g++ gfortran ld nm objcopy objdump ranlib readelf size strings strip; do + tool_upper=$(echo $tool | tr a-z-+ A-Z_X) + if [[ "$tool" == "cc" ]]; then + tool=gcc + elif [[ "$tool" == "fc" ]]; then + tool=gfortran + elif [[ "$tool" == "c++" ]]; then + tool=g++ + elif [[ "$target_platform" != "$build_platform" && "$tool" =~ ^(ar|nm|ranlib)$ ]]; then + tool="gcc-${tool}" + fi + eval "export ${tool_upper}_FOR_BUILD=\$BUILD_PREFIX/bin/\$BUILD-\$tool" + eval "export ${tool_upper}=\$BUILD_PREFIX/bin/\$HOST-\$tool" + eval "export ${tool_upper}_FOR_TARGET=\$BUILD_PREFIX/bin/\$TARGET-\$tool" +done + +if [[ "$cross_target_platform" == "win-64" ]]; then + # do not expect ${prefix}/mingw symlink - this should be superceded by + # 0005-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't! + sed -i 's#${prefix}/mingw/#${prefix}/${target}/sysroot/usr/#g' configure + if [[ "$gcc_maj_ver" == "13" || "$gcc_maj_ver" == "14" ]]; then + sed -i "s#/mingw/#/usr/#g" gcc/config/i386/mingw32.h + else + sed -i "s#/mingw/#/usr/#g" gcc/config/mingw/mingw32.h + fi +else + # prevent mingw patches from being archived in linux conda packages + rm -rf ${RECIPE_DIR}/patches/mingw +fi + +NATIVE_SYSTEM_HEADER_DIR=/usr/include +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot + +# workaround a bug in gcc build files when using external binutils +# and build != host == target +export gcc_cv_objdump=$OBJDUMP_FOR_TARGET + +ls $BUILD_PREFIX/bin/ + +./contrib/download_prerequisites + +# We want CONDA_PREFIX/usr/lib not CONDA_PREFIX/usr/lib64 and this +# is the only way. It is incompatible with multilib (obviously). +TINFO_FILES=$(find . -path "*/config/*/t-*") +for TINFO_FILE in ${TINFO_FILES}; do + echo TINFO_FILE ${TINFO_FILE} + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(lib64\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(libx32\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak +done + +# workaround for https://gcc.gnu.org/bugzilla//show_bug.cgi?id=80196 +if [[ "$gcc_version" == "11."* && "$build_platform" != "$target_platform" ]]; then + sed -i.bak 's@-I$glibcxx_srcdir/libsupc++@-I$glibcxx_srcdir/libsupc++ -nostdinc++@g' libstdc++-v3/configure +fi + +mkdir -p build +cd build + +# We need to explicitly set the gxx include dir because previously +# with ct-ng, native build was not considered native because +# BUILD=HOST=x86_64-build_unknown-linux-gnu and TARGET=x86_64-conda-linux-gnu +# Depending on native or not, the include dir changes. Setting it explictly +# goes back to the original way. +# See https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/configure.ac#L218 + +if [[ "$TARGET" == *linux* ]]; then + GCC_CONFIGURE_OPTIONS+=(--enable-libsanitizer) + GCC_CONFIGURE_OPTIONS+=(--enable-default-pie) + GCC_CONFIGURE_OPTIONS+=(--enable-threads=posix) +fi + +../configure \ + --prefix="$PREFIX" \ + --with-slibdir="$PREFIX/lib" \ + --libdir="$PREFIX/lib" \ + --mandir="$PREFIX/man" \ + --build=$BUILD \ + --host=$HOST \ + --target=$TARGET \ + --enable-languages=c,c++,fortran,objc,obj-c++ \ + --enable-__cxa_atexit \ + --disable-libmudflap \ + --enable-libgomp \ + --disable-libssp \ + --enable-libquadmath \ + --enable-libquadmath-support \ + --enable-lto \ + --enable-target-optspace \ + --enable-plugin \ + --enable-gold \ + --disable-nls \ + --disable-multilib \ + --enable-long-long \ + --with-sysroot=${SYSROOT_DIR} \ + --with-build-sysroot=${BUILD_PREFIX}/${TARGET}/sysroot \ + --with-native-system-header-dir=${NATIVE_SYSTEM_HEADER_DIR} \ + --with-gxx-include-dir="${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/include/c++" \ + "${GCC_CONFIGURE_OPTIONS[@]}" + +# Setting the CPU_COUNT=1 lets you see which job failed! +#CPU_COUNT=1 +make -j${CPU_COUNT} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/c11threads.c b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/c11threads.c new file mode 100644 index 0000000000000000000000000000000000000000..1d0b34c8662f7eca07c573c32eadbdf35a8427e3 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/c11threads.c @@ -0,0 +1,6 @@ +#include +int main() { + mtx_t mutex; + mtx_init(&mutex, mtx_plain); +} + diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/conda_build_config.yaml b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2066b6abe52a8e832f676e8c49dd5a847678ae63 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,49 @@ +triplet: + - x86_64-conda-linux-gnu # [linux and x86_64] + - powerpc64le-conda-linux-gnu # [ppc64le] + - aarch64-conda-linux-gnu # [linux and aarch64] + - x86_64-w64-mingw32 # [win] +gcc_version: + - 15.2.0 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14.3.0 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13.4.0 # [ANACONDA_ROCKET_ENABLE_GCC13] +gcc_maj_ver: + - 15 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13 # [ANACONDA_ROCKET_ENABLE_GCC13] +libgfortran_soname: + - 5 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC13] +binutils_version: + - 2.44 +cross_target_platform: + - linux-64 # [linux and x86_64] + - linux-ppc64le # [ppc64le] + - linux-aarch64 # [linux and aarch64] + - win-64 # [win] +cross_target_stdlib_version: + - 2.28 # [linux and x86_64] + - 2.28 # [ppc64le] + - 2.28 # [linux and aarch64] + - 12 # [win] +cross_target_stdlib: + - sysroot # [linux and x86_64] + - sysroot # [ppc64le] + - sysroot # [linux and aarch64] + - m2w64-sysroot # [win] +# openmp versions +openmp_ver: + - 4.5 +libgomp_ver: + - 1.0.0 +channel_sources: + - conda-forge/label/sysroot-with-crypt,conda-forge +# we could use stdlib("m2w64_c"), but this allows uniform use in setup_compiler.sh +c_stdlib: # [win] + - m2w64-sysroot # [win] +c_stdlib_version: # [win] + - 12 # [win] +with_conda_specs: + - true + - false diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/config.old b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/config.old new file mode 100644 index 0000000000000000000000000000000000000000..90a390a60b40932a63278c29c1f013e7d5254a2d --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/config.old @@ -0,0 +1,530 @@ +# +# Automatically generated file; DO NOT EDIT. +# Crosstool-NG Configuration +# +CT_CONFIGURE_has_static_link=y +CT_CONFIGURE_has_xz=y +CT_CONFIGURE_has_svn=y +CT_MODULES=y + +# +# Paths and misc options +# + +# +# crosstool-NG behavior +# +CT_OBSOLETE=y +CT_EXPERIMENTAL=y +CT_ALLOW_BUILD_AS_ROOT=y +CT_ALLOW_BUILD_AS_ROOT_SURE=y +# CT_DEBUG_CT is not set + +# +# Paths +# +CT_LOCAL_TARBALLS_DIR="${HOME}/src" +CT_SAVE_TARBALLS=y +CT_WORK_DIR="${CT_TOP_DIR}/.build" +CT_PREFIX_DIR="${CT_TOP_DIR}/gcc_built" +CT_BUILD_TOP_DIR="@BUILD_TOP@" +CT_INSTALL_DIR="${CT_PREFIX_DIR}" +CT_RM_RF_PREFIX_DIR=n +CT_REMOVE_DOCS=y +CT_INSTALL_DIR_RO=n +CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y +# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set + +# +# Downloading +# +# CT_FORBID_DOWNLOAD is not set +# CT_FORCE_DOWNLOAD is not set +CT_CONNECT_TIMEOUT=10 +# CT_ONLY_DOWNLOAD is not set +# CT_USE_MIRROR is not set + +# +# Extracting +# +# CT_FORCE_EXTRACT is not set +CT_OVERIDE_CONFIG_GUESS_SUB=y +# CT_ONLY_EXTRACT is not set +CT_PATCH_BUNDLED=y +# CT_PATCH_LOCAL is not set +# CT_PATCH_BUNDLED_LOCAL is not set +# CT_PATCH_LOCAL_BUNDLED is not set +# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set +# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set +# CT_PATCH_NONE is not set +CT_PATCH_ORDER="bundled" + +# +# Build behavior +# +CT_PARALLEL_JOBS=4 +CT_LOAD="" +CT_USE_PIPES=y +CT_EXTRA_CFLAGS_FOR_BUILD="" +CT_EXTRA_LDFLAGS_FOR_BUILD="" +CT_EXTRA_CFLAGS_FOR_HOST="" +CT_EXTRA_LDFLAGS_FOR_HOST="" +# CT_CONFIG_SHELL_SH is not set +# CT_CONFIG_SHELL_ASH is not set +CT_CONFIG_SHELL_BASH=y +# CT_CONFIG_SHELL_CUSTOM is not set +CT_CONFIG_SHELL="${bash}" + +# +# Logging +# +# CT_LOG_ERROR is not set +# CT_LOG_WARN is not set +CT_LOG_INFO=y +# CT_LOG_EXTRA is not set +# CT_LOG_ALL is not set +# CT_LOG_DEBUG is not set +CT_LOG_LEVEL_MAX="INFO" +# CT_LOG_SEE_TOOLS_WARN is not set +CT_LOG_PROGRESS_BAR=y +CT_LOG_TO_FILE=y +CT_LOG_FILE_COMPRESS=y + +# +# Target options +# +CT_ARCH="arm" +CT_ARCH_SUPPORTS_BOTH_MMU=y +CT_ARCH_SUPPORTS_BOTH_ENDIAN=y +CT_ARCH_SUPPORTS_32=y +CT_ARCH_SUPPORTS_64=y +CT_ARCH_SUPPORTS_WITH_ARCH=y +CT_ARCH_SUPPORTS_WITH_CPU=y +CT_ARCH_SUPPORTS_WITH_TUNE=y +CT_ARCH_SUPPORTS_WITH_FLOAT=y +CT_ARCH_SUPPORTS_WITH_FPU=y +CT_ARCH_SUPPORTS_SOFTFP=y +CT_ARCH_DEFAULT_HAS_MMU=y +CT_ARCH_DEFAULT_LE=y +CT_ARCH_DEFAULT_32=y +CT_ARCH_CPU="arm1136jf-s" +CT_ARCH_FPU="vfp" +# CT_ARCH_BE is not set +CT_ARCH_LE=y +CT_ARCH_32=y +# CT_ARCH_64 is not set +CT_ARCH_BITNESS=32 +# CT_ARCH_FLOAT_HW is not set +CT_ARCH_FLOAT_SW=y +CT_TARGET_CFLAGS="" +CT_TARGET_LDFLAGS="" +# CT_ARCH_alpha is not set +CT_ARCH_arm=y +# CT_ARCH_avr is not set +# CT_ARCH_m68k is not set +# CT_ARCH_microblaze is not set +# CT_ARCH_mips is not set +# CT_ARCH_nios2 is not set +# CT_ARCH_powerpc is not set +# CT_ARCH_s390 is not set +# CT_ARCH_sh is not set +# CT_ARCH_sparc is not set +# CT_ARCH_x86 is not set +# CT_ARCH_xtensa is not set +CT_ARCH_alpha_AVAILABLE=y +CT_ARCH_arm_AVAILABLE=y +CT_ARCH_avr_AVAILABLE=y +CT_ARCH_m68k_AVAILABLE=y +CT_ARCH_microblaze_AVAILABLE=y +CT_ARCH_mips_AVAILABLE=y +CT_ARCH_nios2_AVAILABLE=y +CT_ARCH_powerpc_AVAILABLE=y +CT_ARCH_s390_AVAILABLE=y +CT_ARCH_sh_AVAILABLE=y +CT_ARCH_sparc_AVAILABLE=y +CT_ARCH_x86_AVAILABLE=y +CT_ARCH_xtensa_AVAILABLE=y +CT_ARCH_SUFFIX="" + +# +# Generic target options +# +# CT_MULTILIB is not set +# CT_DISABLE_MULTILIB_LIB_OSDIRNAMES is not set +CT_ARCH_USE_MMU=y +CT_ARCH_ENDIAN="little" +CT_ARCH_32=y + +# +# Target optimisations +# +CT_ARCH_EXCLUSIVE_WITH_CPU=y +# CT_ARCH_FLOAT_AUTO is not set +# CT_ARCH_FLOAT_SOFTFP is not set +CT_ARCH_FLOAT="soft" + +# +# arm other options +# +CT_ARCH_ARM_MODE="arm" +CT_ARCH_ARM_MODE_ARM=y +# CT_ARCH_ARM_MODE_THUMB is not set +# CT_ARCH_ARM_INTERWORKING is not set +CT_ARCH_ARM_EABI_FORCE=y +CT_ARCH_ARM_EABI=y + +# +# Toolchain options +# + +# +# General toolchain options +# +CT_FORCE_SYSROOT=y +CT_USE_SYSROOT=y +CT_SYSROOT_NAME="sysroot" +CT_SYSROOT_DIR_PREFIX="" +CT_WANTS_STATIC_LINK=y +CT_STATIC_TOOLCHAIN=y +CT_TOOLCHAIN_PKGVERSION="" +CT_TOOLCHAIN_BUGURL="" + +# +# Tuple completion and aliasing +# +CT_TARGET_VENDOR="unknown" +CT_TARGET_ALIAS_SED_EXPR="" +CT_TARGET_ALIAS="" + +# +# Toolchain type +# +# CT_NATIVE is not set +CT_CROSS=y +# CT_CROSS_NATIVE is not set +# CT_CANADIAN is not set +CT_TOOLCHAIN_TYPE="cross" + +# +# Build system +# +CT_BUILD="x86_64-pc-linux-gnu" +CT_BUILD_PREFIX="" +CT_BUILD_SUFFIX="" + +# +# Misc options +# +# CT_TOOLCHAIN_ENABLE_NLS is not set + +# +# Operating System +# +CT_KERNEL_SUPPORTS_SHARED_LIBS=y +CT_KERNEL="linux" +CT_KERNEL_VERSION="3.2.43" +# CT_KERNEL_bare_metal is not set +CT_KERNEL_linux=y +CT_KERNEL_bare_metal_AVAILABLE=y +CT_KERNEL_linux_AVAILABLE=y +# CT_KERNEL_LINUX_CUSTOM is not set +# CT_KERNEL_V_4_4 is not set +# CT_KERNEL_V_4_3 is not set +# CT_KERNEL_V_4_1 is not set +# CT_KERNEL_V_3_18 is not set +# CT_KERNEL_V_3_14 is not set +# CT_KERNEL_V_3_12 is not set +# CT_KERNEL_V_3_10 is not set +# CT_KERNEL_V_3_7 is not set +# CT_KERNEL_V_3_4 is not set +# CT_KERNEL_V_3_2 is not set +CT_KERNEL_V_3_2_43=y +# CT_KERNEL_V_2_6_32 is not set +# CT_KERNEL_V_2_6_18 is not set +CT_KERNEL_windows_AVAILABLE=y + +# +# Common kernel options +# +CT_SHARED_LIBS=y + +# +# linux other options +# +# CT_KERNEL_LINUX_VERBOSITY_0 is not set +CT_KERNEL_LINUX_VERBOSITY_1=y +# CT_KERNEL_LINUX_VERBOSITY_2 is not set +CT_KERNEL_LINUX_VERBOSE_LEVEL=1 +CT_KERNEL_LINUX_INSTALL_CHECK=y + +# +# Binary utilities +# +CT_ARCH_BINFMT_ELF=y +CT_BINUTILS="binutils" +CT_BINUTILS_binutils=y + +# +# GNU binutils +# +# CT_BINUTILS_CUSTOM is not set +CT_BINUTILS_VERSION="2.27" +# CT_CC_BINUTILS_SHOW_LINARO is not set +CT_BINUTILS_V_2_27=y +# CT_BINUTILS_V_2_25_1 is not set +# CT_BINUTILS_V_2_24 is not set +# CT_BINUTILS_V_2_23_2 is not set +CT_BINUTILS_2_26_or_later=y +CT_BINUTILS_2_25_1_or_later=y +CT_BINUTILS_2_25_or_later=y +CT_BINUTILS_2_24_or_later=y +CT_BINUTILS_2_23_2_or_later=y +CT_BINUTILS_HAS_HASH_STYLE=y +CT_BINUTILS_HAS_GOLD=y +CT_BINUTILS_GOLD_SUPPORTS_ARCH=y +CT_BINUTILS_HAS_PLUGINS=y +CT_BINUTILS_HAS_PKGVERSION_BUGURL=y +CT_BINUTILS_LINKER_LD=y +CT_BINUTILS_LINKERS_LIST="ld" +CT_BINUTILS_LINKER_DEFAULT="bfd" +CT_BINUTILS_EXTRA_CONFIG_ARRAY="" +CT_BINUTILS_FOR_TARGET=y +CT_BINUTILS_FOR_TARGET_IBERTY=y +CT_BINUTILS_FOR_TARGET_BFD=y +CT_BINUTILS_PLUGINS=y + +# +# binutils other options +# + +# +# C-library +# +CT_LIBC="uClibc" +CT_LIBC_VERSION="0.9.33.2" +# CT_LIBC_glibc is not set +# CT_LIBC_musl is not set +CT_LIBC_uClibc=y +CT_LIBC_avr_libc_AVAILABLE=y +CT_LIBC_glibc_AVAILABLE=y +CT_THREADS="nptl" +CT_LIBC_mingw_AVAILABLE=y +CT_LIBC_musl_AVAILABLE=y +CT_LIBC_newlib_AVAILABLE=y +CT_LIBC_none_AVAILABLE=y +CT_LIBC_uClibc_AVAILABLE=y + +CT_LIBC_UCLIBC_CUSTOM=n +CT_LIBC_UCLIBC_NG=n +CT_LIBC_UCLIBC_NG_V_1_0_22=n +CT_LIBC_UCLIBC_NG_V_1_0_21=n +CT_LIBC_UCLIBC_NG_V_1_0_20=n +CT_LIBC_UCLIBC_V_0_9_33_2=y + +CT_LIBC_UCLIBC_PARALLEL=y +# CT_LIBC_UCLIBC_VERBOSITY_0 is not set +# CT_LIBC_UCLIBC_VERBOSITY_1 is not set +CT_LIBC_UCLIBC_VERBOSITY_2=y +CT_LIBC_UCLIBC_VERBOSITY="V=2" +CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y +# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_3 is not set +CT_LIBC_UCLIBC_DEBUG_LEVEL=0 +CT_LIBC_UCLIBC_CONFIG_FILE="" +CT_LIBC_SUPPORT_THREADS_ANY=y +CT_LIBC_SUPPORT_THREADS_NATIVE=y +CT_LIBC_SUPPORT_THREADS_LT=y +CT_LIBC_SUPPORT_THREADS_NONE=y + +# +# Common C library options +# +CT_THREADS_NATIVE=y +# CT_THREADS_LT is not set +# CT_THREADS_NONE is not set +CT_LIBC_XLDD=y + +# +# uClibc other options +# +CT_LIBC_UCLIBC_LNXTHRD="" +# CT_LIBC_UCLIBC_LOCALES is not set +CT_LIBC_UCLIBC_IPV6=y +CT_LIBC_UCLIBC_WCHAR=y +# CT_LIBC_UCLIBC_FENV is not set + +# +# C compiler +# +CT_CC="gcc" +CT_CC_CORE_PASSES_NEEDED=y +CT_CC_CORE_PASS_1_NEEDED=y +CT_CC_CORE_PASS_2_NEEDED=y +CT_CC_gcc=y +# CT_CC_GCC_CUSTOM is not set +CT_CC_GCC_VERSION="6.3.0" +# CT_CC_GCC_SHOW_LINARO is not set +CT_CC_GCC_V_6_3_0=y +# CT_CC_GCC_V_6_1_0 is not set +# CT_CC_GCC_V_5_4_0 is not set +# CT_CC_GCC_V_4_9_3 is not set +# CT_CC_GCC_V_4_8_5 is not set +CT_CC_GCC_4_8_or_later=y +CT_CC_GCC_4_9_or_later=y +CT_CC_GCC_5_or_later=y +CT_CC_GCC_6=y +CT_CC_GCC_6_or_later=y +CT_CC_GCC_HAS_GRAPHITE=y +CT_CC_GCC_USE_GRAPHITE=y +CT_CC_GCC_HAS_LTO=y +CT_CC_GCC_USE_LTO=y +CT_CC_GCC_HAS_PKGVERSION_BUGURL=y +CT_CC_GCC_HAS_BUILD_ID=y +CT_CC_GCC_HAS_LNK_HASH_STYLE=y +CT_CC_GCC_USE_GMP_MPFR=y +CT_CC_GCC_USE_MPC=y +CT_CC_GCC_HAS_LIBQUADMATH=y +CT_CC_GCC_HAS_LIBSANITIZER=y +CT_CC_LANG_FORTRAN=y +CT_CC_GCC_ENABLE_CXX_FLAGS="" +CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_STATIC_LIBSTDCXX=y +# CT_CC_GCC_SYSTEM_ZLIB is not set +# This does not work but it seems currently possible +# to hack it and use the stage2 liblto.so as long as +# you manually copy it to the right place. For conda +# compiler packages, we add it to binutils, since it +# is executed by programs in that package. +# Really, needs a CT_MOSTLY_STATIC_TOOLCHAIN config +# option that uses -fPIC for all companion libs and +# builds them statically and then the exes are just +# dynamic exes that happen to link only to glibc in +# a dynamic way. +CT_CC_GCC_ENABLE_PLUGINS=n + +# +# Optimisation features +# + +# +# Settings for libraries running on target +# +CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y +# CT_CC_GCC_LIBMUDFLAP is not set +# CT_CC_GCC_LIBGOMP is not set +# CT_CC_GCC_LIBSSP is not set +# CT_CC_GCC_LIBQUADMATH is not set + +# +# Misc. obscure options. +# +CT_CC_CXA_ATEXIT=y +# CT_CC_GCC_DISABLE_PCH is not set +CT_CC_GCC_SJLJ_EXCEPTIONS=m +CT_CC_GCC_LDBL_128=m +# CT_CC_GCC_BUILD_ID is not set +CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y +# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set +# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set +# CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set +CT_CC_GCC_LNK_HASH_STYLE="" +CT_CC_GCC_DEC_FLOAT_AUTO=y +# CT_CC_GCC_DEC_FLOAT_BID is not set +# CT_CC_GCC_DEC_FLOAT_DPD is not set +# CT_CC_GCC_DEC_FLOATS_NO is not set +CT_CC_SUPPORT_CXX=y +CT_CC_SUPPORT_FORTRAN=y +CT_CC_SUPPORT_JAVA=y +CT_CC_SUPPORT_ADA=y +CT_CC_SUPPORT_OBJC=y +CT_CC_SUPPORT_OBJCXX=y +CT_CC_SUPPORT_GOLANG=y + +# +# Additional supported languages: +# +CT_CC_LANG_CXX=y +# CT_CC_LANG_JAVA is not set +# CT_CC_LANG_ADA is not set +CT_CC_LANG_OBJC=y +CT_CC_LANG_OBJCXX=y +# CT_CC_LANG_GOLANG is not set +CT_CC_LANG_OTHERS="" + +# +# Debug facilities +# +# CT_DEBUG_dmalloc is not set +# CT_DEBUG_duma is not set +# CT_DEBUG_gdb is not set +# CT_DEBUG_ltrace is not set +# CT_DEBUG_strace is not set + +# +# Companion libraries +# +CT_COMPLIBS_NEEDED=y +CT_GMP_NEEDED=y +CT_MPFR_NEEDED=y +CT_ISL_NEEDED=y +CT_MPC_NEEDED=y +CT_COMPLIBS=y +CT_GMP=y +CT_MPFR=y +CT_ISL=y +CT_MPC=y +CT_GMP_V_6_1_2=y +# CT_GMP_V_6_0_0 is not set +# CT_GMP_V_5_1_3 is not set +# CT_GMP_V_5_1_1 is not set +# CT_GMP_V_5_0_2 is not set +# CT_GMP_V_5_0_1 is not set +# CT_GMP_V_4_3_2 is not set +# CT_GMP_V_4_3_1 is not set +# CT_GMP_V_4_3_0 is not set +CT_GMP_5_0_2_or_later=y +CT_GMP_VERSION="6.1.2" +CT_MPFR_V_3_1_5=y +# CT_MPFR_V_3_1_2 is not set +# CT_MPFR_V_3_1_0 is not set +# CT_MPFR_V_3_0_1 is not set +# CT_MPFR_V_3_0_0 is not set +# CT_MPFR_V_2_4_2 is not set +# CT_MPFR_V_2_4_1 is not set +# CT_MPFR_V_2_4_0 is not set +CT_MPFR_VERSION="3.1.5" +CT_ISL_V_0_18=y +# CT_ISL_V_0_12_2 is not set +CT_ISL_V_0_14_or_later=y +CT_ISL_V_0_12_or_later=y +CT_ISL_VERSION="0.18" +CT_MPC_V_1_0_3=y +# CT_MPC_V_1_0_2 is not set +# CT_MPC_V_1_0_1 is not set +# CT_MPC_V_1_0 is not set +# CT_MPC_V_0_9 is not set +# CT_MPC_V_0_8_2 is not set +# CT_MPC_V_0_8_1 is not set +# CT_MPC_V_0_7 is not set +CT_MPC_VERSION="1.0.3" + +# +# Companion libraries common options +# +# CT_COMPLIBS_CHECK is not set + +# +# Companion tools +# + +# +# READ HELP before you say 'Y' below !!! +# +# CT_COMP_TOOLS is not set + +# +# Test suite +# +# CT_TEST_SUITE_GCC is not set diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/get_cpu_arch.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/get_cpu_arch.sh new file mode 100644 index 0000000000000000000000000000000000000000..b7ec10f51bb3d6f9d3709715366948dd28dd0a4c --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/get_cpu_arch.sh @@ -0,0 +1,35 @@ +get_cpu_arch() { + local CPU_ARCH + if [[ "$1" == *"-64" ]]; then + CPU_ARCH="x86_64" + elif [[ "$1" == *"-ppc64le" ]]; then + CPU_ARCH="powerpc64le" + elif [[ "$1" == *"-aarch64" ]]; then + CPU_ARCH="aarch64" + elif [[ "$1" == *"-s390x" ]]; then + CPU_ARCH="s390x" + else + echo "Unknown architecture" + exit 1 + fi + echo $CPU_ARCH +} + +get_triplet() { + if [[ "$1" == linux-* ]]; then + echo "$(get_cpu_arch $1)-conda-linux-gnu" + elif [[ "$1" == osx-64 ]]; then + echo "x86_64-apple-darwin13.4.0" + elif [[ "$1" == osx-arm64 ]]; then + echo "arm64-apple-darwin20.0.0" + elif [[ "$1" == win-64 ]]; then + echo "x86_64-w64-mingw32" + else + echo "unknown platform" + exit 1 + fi +} + +export BUILD="$(get_triplet $build_platform)" +export HOST="$(get_triplet $target_platform)" +export TARGET="$(get_triplet $cross_target_platform)" diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/hello-world.cpp b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/hello-world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abdfa651565e60579d61d05bc45afd98be1d3457 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/hello-world.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char * argv[]) +{ + std::cout << "Hello World!\n" << std::endl; + return 0; +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-conda-specs.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-conda-specs.sh new file mode 100644 index 0000000000000000000000000000000000000000..01a4d1c950f9d00380efc5a2df4efb96753b87d3 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-conda-specs.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +set -ex +export CHOST="${triplet}" +specdir=$PREFIX/lib/gcc/$CHOST/${gcc_version} +if [[ "$cross_target_platform" == "$target_platform" ]]; then + install -Dm644 -T ${SRC_DIR}/build/gcc/specs $specdir/conda.specs + + # Add specs when we're not cross compiling so that the toolchain works more like a system + # toolchain (i.e. conda installed libs can be #include <>'d and linked without adding any + # cmdline args or FLAGS and likewise the assumptions we have about rpath are built in) + # + # THIS IS INTENDED as a safety net for casual users who just want the native toolchain to work. + # It is not to be relied on by conda-forge package recipes and best practice is still to set the + # appropriate FLAGS vars (either via compiler activation scripts or explicitly in the recipe) + # + # We use double quotes here because we want $PREFIX and $CHOST to be expanded at build time + # and recorded in the specs file. It will undergo a prefix replacement when our compiler + # package is installed. + sed -i -e "/\*link_command:/,+1 s+%.*+& %{\!static:-rpath ${PREFIX}/lib -rpath-link ${PREFIX}/lib} -L ${PREFIX}/lib/stubs -L ${PREFIX}/lib+" $specdir/conda.specs + if [[ "$cross_target_platform" != "win-"* ]]; then + # put -disable-new-dtags at the front of the cmdline so that user provided -enable-new-dtags (in %l) can override it + sed -i -e "/\*link_command:/,+1 s+%(linker)+& -disable-new-dtags +" $specdir/conda.specs + fi + # use -idirafter to put the conda "system" includes where /usr/local/include would typically go + # in a system-packaged non-cross compiler + sed -i -e "/\*cpp_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + # cc1_options also get used for cc1plus... at least in 11.2.0 + sed -i -e "/\*cc1_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + +else + # does it even make sense to do anything here? Could do something with %:getenv(BUILD_PREFIX /include) + # but in the case that we aren't inside conda-build, it will cause gcc to fatal + # because it won't be set. Just explicitly making this fail for now so that the meta.yaml + # is consitent with when it creates the conda-gcc-specs package + false +fi diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-g++.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-g++.sh new file mode 100644 index 0000000000000000000000000000000000000000..f1cf84ba32fb914e5ef29ee9b11a6195049534f5 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-g++.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C gcc prefix=${PREFIX} c++.install-common + +# How it used to be: +# install -m755 -t ${PREFIX}/bin/ gcc/{cc1plus,lto1} +for file in cc1plus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +# Following 3 are in libstdcxx-devel +#make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/python prefix=${PREFIX} install + +# Probably don't want to do this for cross-compilers +# mkdir -p ${PREFIX}/share/gdb/auto-load/usr/lib/ +# cp ${SRC_DIR}/gcc_built/${CHOST}/sysroot/lib/libstdc++.so.6.*-gdb.py ${PREFIX}/share/gdb/auto-load/usr/lib/ + +make -C libcpp prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${PKG_VERSION} + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gcc.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..da5e0e54e5b5cfd10c4e0b3b0e70bf30a61baf23 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gcc.sh @@ -0,0 +1,262 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +_libdir=libexec/gcc/${TARGET}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + # We may not have built with plugin support so failure here is not fatal: + make prefix=${PREFIX} install-lto-plugin || true + + sed -i.bak 's/install-collect2: collect2 /install-collect2: collect2$(exeext) /g' gcc/Makefile + make -C gcc prefix=${PREFIX} install-driver install-cpp install-gcc-ar install-headers install-plugin install-lto-wrapper install-collect2 + # not sure if this is the same as the line above. Run both, just in case + make -C lto-plugin prefix=${PREFIX} install + install -dm755 ${PREFIX}/lib/bfd-plugins/ + + # statically linked, so this so does not exist + # ln -s $PREFIX/lib/gcc/$TARGET/liblto_plugin.so ${PREFIX}/lib/bfd-plugins/ + + make -C libcpp prefix=${PREFIX} install + + # Include languages we do not have any other place for here (and also lto1) + for file in gnat1 brig1 cc1 go1 lto1 cc1obj cc1objplus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi + done + + # https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/Makefile.in#L3481-L3526 + # Could have used install-common, but it also installs cxx binaries, which we + # don't want in this package. We could patch it, or use the loop below: + for file in gcov{,-tool,-dump}; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/bin/${TARGET}-${file}${EXEEXT} + fi + done + + make prefix=${PREFIX}/lib/gcc/${TARGET}/${gcc_version} install-libcc1 + install -d ${PREFIX}/share/gdb/auto-load/usr/lib + + make prefix=${PREFIX} install-fixincludes + make -C gcc prefix=${PREFIX} install-mkheaders + + if [[ -d ${TARGET}/libatomic ]]; then + make -C ${TARGET}/libatomic prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libgomp ]]; then + make -C ${TARGET}/libgomp prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libitm ]]; then + make -C ${TARGET}/libitm prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libquadmath ]]; then + make -C ${TARGET}/libquadmath prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer ]]; then + make -C ${TARGET}/libsanitizer prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/asan ]]; then + make -C ${TARGET}/libsanitizer/asan prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/tsan ]]; then + make -C ${TARGET}/libsanitizer/tsan prefix=${PREFIX} install + fi + + make -C libiberty prefix=${PREFIX} install + # install PIC version of libiberty + if [[ "${TARGET}" != *mingw* ]]; then + install -m644 libiberty/pic/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + else + install -m644 libiberty/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + fi + + make -C gcc prefix=${PREFIX} install-man install-info + + make -C gcc prefix=${PREFIX} install-po + + # many packages expect this symlink + [[ -f ${PREFIX}/bin/${TARGET}-cc${EXEEXT} ]] && rm ${PREFIX}/bin/${TARGET}-cc${EXEEXT} + pushd ${PREFIX}/bin + if [[ "${HOST}" != *mingw* ]]; then + ln -s ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + else + cp ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + fi + popd + + # POSIX conformance launcher scripts for c89 and c99 + cat > ${PREFIX}/bin/${TARGET}-c89${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c89" +for opt; do + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) fl="";; + -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c89${EXEEXT} $fl ${1+"$@"} +EOF + + cat > ${PREFIX}/bin/${TARGET}-c99${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c99" +for opt; do + case "$opt" in + -std=c99|-std=iso9899:1999) fl="";; + -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c99${EXEEXT} $fl ${1+"$@"} +EOF + + chmod 755 ${PREFIX}/bin/${TARGET}-c{8,9}9${EXEEXT} + + rm ${PREFIX}/bin/${TARGET}-gcc-${PKG_VERSION}${EXEEXT} + +popd + +# generate specfile so that we can patch loader link path +# link_libgcc should have the gcc's own libraries by default (-R) +# so that LD_LIBRARY_PATH isn't required for basic libraries. +# +# GF method here to create specs file and edit it. The other methods +# tried had no effect on the result. including: +# setting LINK_LIBGCC_SPECS on configure +# setting LINK_LIBGCC_SPECS on make +# setting LINK_LIBGCC_SPECS in gcc/Makefile +specdir=$PREFIX/lib/gcc/$TARGET/${gcc_version} +if [[ "$build_platform" == "$target_platform" ]]; then + $PREFIX/bin/${TARGET}-gcc${EXEEXT} -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +elif [[ "$target_platform" == "$cross_target_platform" && ${TARGET} != *mingw* ]]; then + # For support of of native specs, we need this + # This is the only place where we need QEMU. + # Remove this elif condition for local experimentation if you + # do not have QEMU setup + $PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs +else + $BUILD_PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +fi + +# make a copy of the specs without our additions so that people can choose not to use them +# by passing -specs=builtin.specs +cp $specdir/specs $specdir/builtin.specs + +# modify the default specs to only have %include_noerr that includes an optional conda.specs +# package installable via the conda-gcc-specs package where conda.specs (for $cross_target_platform +# == $target_platform) will add the minimal set of flags for the 'native' toolchains to be useable +# without anything additional set in the enviornment or extra cmdline args. +echo "%include_noerr " >> $specdir/specs + +# We use double quotes here because we want $PREFIX and $TARGET to be expanded at build time +# and recorded in the specs file. It will undergo a prefix replacement when our compiler +# package is installed. +sed -i -e "/\*link_command:/,+1 s+%.*+& %{!static:-rpath ${PREFIX}/lib}+" $specdir/specs + + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc/RUNTIME.LIBRARY.EXCEPTION + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${TARGET}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +set -x + +#${PREFIX}/bin/${TARGET}-gcc "${RECIPE_DIR}"/c11threads.c -std=c11 + +mkdir -p ${PREFIX}/${TARGET}/lib +mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + # making these this way so conda build doesn't muck with them + pushd ${PREFIX}/${TARGET}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -sf ../../lib/libgomp.so libgomp.so + for lib in libgfortran libatomic libquadmath libitm lib{a,hwa,l,ub,t}san; do + for f in ${PREFIX}/lib/${lib}.so*; do + ln -s ../../lib/$(basename $f) ${PREFIX}/${TARGET}/lib/$(basename $f) + done + done + fi + + for f in ${PREFIX}/lib/*.spec; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + if [[ "${TARGET}" != *mingw* ]]; then + for f in ${PREFIX}/lib/*.o; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + fi + popd + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done + for lib in libasan.so libatomic.so libgomp.so libhwasan.so libitm.so liblsan.so libquadmath.so libtsan.so libubsan.so libstdc++.so libstdc++.so.6 libgcc_s.so; do + if [[ -f "${PREFIX}/lib/${lib}" ]]; then + # install a shared library here since the directory ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + # has the highest preference and we want shared libraries to have the highest preference + rm ${PREFIX}/lib/${lib} + ln -sf ${PREFIX}/lib/${lib} ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +else + source ${RECIPE_DIR}/install-libgcc.sh + for lib in libcc1; do + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + done + rm -f ${PREFIX}/share/info/*.info + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/${TARGET}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.so" ]]; then + ln -sf ${PREFIX}/${TARGET}/lib/lib${lib}.so ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +fi + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${TARGET}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gdb-pretty-printer.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gdb-pretty-printer.sh new file mode 100644 index 0000000000000000000000000000000000000000..c73dfd015673e079a1d2df9e656fb2e20d7bca1a --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gdb-pretty-printer.sh @@ -0,0 +1,10 @@ +set -e -x + +# install gcc's gdbhooks ... +mkdir -p "$SP_DIR"/gcc +cp $SRC_DIR/gcc/gcc/gdbhooks.py "$SP_DIR"/gcc/. + +# install libstdc++'s pretty printer support +cp -r $SRC_DIR/gcc/libstdc++-v3/python/libstdcxx "$SP_DIR"/. + +exit 0 diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gfortran.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..46d877def15e561206381f98e1db227944f02256 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-gfortran.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +# adapted from Arch install script from https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/gcc/PKGBUILD +# We cannot make install since .la files are not relocatable so libtool deliberately prevents it: +# libtool: install: error: cannot install `libgfortran.la' to a directory not ending in ${SRC_DIR}/work/gcc_built/${CHOST}/lib/../lib +make -C ${CHOST}/libgfortran prefix=${PREFIX} all-multi libgfortran.spec ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod config.h +make -C gcc prefix=${PREFIX} fortran.install-{common,man,info} + +# How it used to be: +# install -Dm755 gcc/f951 ${PREFIX}/${_libdir}/f951 +for file in f951; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +mkdir -p ${PREFIX}/${CHOST}/lib +cp ${CHOST}/libgfortran/libgfortran.spec ${PREFIX}/${CHOST}/lib + +pushd ${PREFIX}/bin + if [[ "${target_platform}" != "win-64" ]]; then + ln -sf ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + else + cp ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + fi +popd + +make install DESTDIR=$SRC_DIR/build-finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/* $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/ +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/*.h $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/ + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION + +if [[ "${target_platform}" != "${cross_target_platform}" ]]; then + if [[ ${triplet} == *linux* ]]; then + cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/${CHOST}/lib/ + fi +fi +cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran.*a ${PREFIX}/${CHOST}/lib/ + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${CHOST}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-devel.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ba08fc16608017c3a0545c4d8984f9aa7586a25 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-devel.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C ${CHOST}/libgcc prefix=${PREFIX} install + +# ${PREFIX}/lib/libgcc_s.so* goes into libgcc output, but +# avoid that the equivalents in ${PREFIX}/${CHOST}/lib end up +# in gcc_impl_{{ cross_target_platform }}, c.f. install-gcc.sh +mkdir -p ${PREFIX}/${CHOST}/lib +if [[ "${triplet}" == *linux* ]]; then + mv ${PREFIX}/lib/libgcc_s.so* ${PREFIX}/${CHOST}/lib +else + # import library, not static library + mv ${PREFIX}/lib/libgcc_s.a ${PREFIX}/${CHOST}/lib + rm ${PREFIX}/lib/libgcc_s*.dll || true +fi +# This is in gcc_impl as it is gcc specific and clang has the same header +rm -rf ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/include/unwind.h + +popd + diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-no-gomp.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-no-gomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..e792608072235cedbc2836ec05a7bc9326d53862 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc-no-gomp.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# we have to remove existing links/files so that the libgcc install works +rm -rf ${PREFIX}/lib/* +rm -rf ${PREFIX}/share/* +rm -f ${PREFIX}/${CHOST}/lib/libgomp* + +# now run install of libgcc +# this reinstalls the wrong symlinks for openmp +source ${RECIPE_DIR}/install-libgcc.sh + +# remove and relink things for openmp +rm -f ${PREFIX}/lib/libgomp.so +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so +rm -f ${PREFIX}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver} + +# (re)make the right links +# note that this code is remaking more links than the ones we want in this +# package but that is ok +pushd ${PREFIX}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} + fi +popd diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..34a2effaa2d99c20bf30004b03a5fed5ba1fdbdb --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgcc.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + if [[ "${PKG_NAME}" == "libgcc" ]]; then + make -C ${TARGET}/libgcc prefix=${PREFIX} install-shared + if [[ "${TARGET}" == *mingw* ]]; then + mv $PREFIX/lib/libgcc_s*.dll $PREFIX/bin + fi + elif [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # when building a cross compiler, above make line will clobber $PREFIX/lib/libgcc_s.so.1 + # and fail after some point for some architectures. To avoid that, we copy manually + pushd ${TARGET}/libgcc + mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + install -c -m 644 libgcc_eh.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + chmod 644 ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + ${TARGET}-ranlib ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + + mkdir -p ${PREFIX}/${TARGET}/lib + if [[ "${triplet}" == *linux* ]]; then + install -c -m 644 ./libgcc_s.so.1 ${PREFIX}/${TARGET}/lib/libgcc_s.so.1 + cp $RECIPE_DIR/libgcc_s.so.ldscript ${PREFIX}/${TARGET}/lib/libgcc_s.so + else + # import library, not static library + install -c -m 644 ./shlib/libgcc_s.a ${PREFIX}/${TARGET}/lib/libgcc_s.a + fi + popd + fi + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/libsanitizer/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/libsanitizer/libtool + fi + for lib in libatomic libgomp libquadmath libitm libvtv libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/${lib}/libtool + fi + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${TARGET}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + + for lib in libgomp libquadmath; do + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-info + fi + done + +popd + +mkdir -p ${PREFIX}/lib + +if [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # no static libs + find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +fi +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +if [[ "${PKG_NAME}" != gcc_impl* ]]; then + # mv ${PREFIX}/${TARGET}/lib/* ${PREFIX}/lib + # clean up empty folder + rm -rf ${PREFIX}/lib/gcc + rm -rf ${PREFIX}/lib/lib{a,hwa,l,ub,t}san.so* + + # Install Runtime Library Exception + install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION +fi + +rm -f ${PREFIX}/share/info/dir diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgfortran.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..031da5eca76ae9762aa193eb3310b7923fd844c6 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgfortran.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +rm -f ${PREFIX}/lib/libgfortran* || true + +if [[ "${TARGET}" == *mingw* ]]; then + mkdir -p ${PREFIX}/bin/ + cp ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.dll ${PREFIX}/bin/ +else + mkdir -p ${PREFIX}/lib + cp -f --no-dereference ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/lib/ +fi + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libgfortran/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgomp.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..cdd189f59dd81af7df42846c40b9300bf64dcd1e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libgomp.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +cd build + +make -C ${triplet}/libgomp prefix=${PREFIX} install-toolexeclibLTLIBRARIES +rm ${PREFIX}/lib/libgomp.a ${PREFIX}/lib/libgomp.la + +if [[ "$target_platform" == "linux-"* ]]; then + rm ${PREFIX}/lib/libgomp.so.1 + rm ${PREFIX}/lib/libgomp.so + ln -sf ${PREFIX}/lib/libgomp.so.${libgomp_ver} ${PREFIX}/lib/libgomp.so +else + rm ${PREFIX}/lib/libgomp.dll.a +fi + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libsanitizer.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libsanitizer.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ef36d3bb8c750e42929f231de9d22a6e0addd40 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libsanitizer.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +mkdir -p ${PREFIX}/lib + +pushd ${SRC_DIR}/build + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/libsanitizer/libtool + for lib in libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${CHOST}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/${lib}/libtool + fi + if [[ -d ${CHOST}/${lib} ]]; then + make -C ${CHOST}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + +popd + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++-devel.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..63b0439991dbb35a966fa02069d04899b13420f2 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++-devel.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +# export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${gcc_version} +mkdir -p ${PREFIX}/${CHOST}/lib + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + mv $PREFIX/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ + if [[ "$target_platform" == linux-* ]]; then + mv ${PREFIX}/lib/libstdc++.so* ${PREFIX}/${CHOST}/lib + else + rm ${PREFIX}/bin/libstdc++*.dll + fi +else + mv $PREFIX/${CHOST}/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ +fi + +popd + diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++.sh new file mode 100644 index 0000000000000000000000000000000000000000..3d878849ae7b3d9282a04a885cd29df782b7d038 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-libstdc++.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + make -C ${CHOST}/libstdc++-v3/src prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/libstdc++-v3/po prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib +#mv ${PREFIX}/${CHOST}/lib/* ${PREFIX}/lib + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libstdc++/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-openmp_impl.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-openmp_impl.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4ebad09aa18a43830fe2e9be9be97c9e965c354 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-openmp_impl.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +mkdir -p ${PREFIX}/lib + +pushd ${PREFIX}/lib/ + +if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} +fi +popd diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-symlinks.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-symlinks.sh new file mode 100644 index 0000000000000000000000000000000000000000..fd4887286b42cf9e1effd5a1931b9dc3224a3d9a --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/install-symlinks.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +if [[ "$target_platform" == "win-"* ]]; then + symlink_or_copy="cp" +else + symlink_or_copy="ln -sf" +fi + +if [[ "${PKG_NAME}" == "gcc" ]]; then + for tool in cc cpp gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do + $symlink_or_copy ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ${PREFIX}/bin/${tool}${EXEEXT} + done +elif [[ "${PKG_NAME}" == "gxx" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-g++${EXEEXT} ${PREFIX}/bin/g++${EXEEXT} + $symlink_or_copy ${PREFIX}/bin/${triplet}-c++${EXEEXT} ${PREFIX}/bin/c++${EXEEXT} +elif [[ "${PKG_NAME}" == "gfortran" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-gfortran${EXEEXT} ${PREFIX}/bin/gfortran${EXEEXT} +fi diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/libgcc_s.so.ldscript b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/libgcc_s.so.ldscript new file mode 100644 index 0000000000000000000000000000000000000000..c8e92242fc5b32888222e279088df08e791bd52c --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/libgcc_s.so.ldscript @@ -0,0 +1,4 @@ +/* GNU ld script + Use the shared library, but some functions are only in + the static library. */ +GROUP ( libgcc_s.so.1 -lgcc ) diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/make_tool_links.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/make_tool_links.sh new file mode 100644 index 0000000000000000000000000000000000000000..26ad874c355cef4faa81da40d32fd985742f6262 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/make_tool_links.sh @@ -0,0 +1,11 @@ +# When host=target, gcc installs un-prefixed tools together with prefixed-tools +# In the case of cpp, only un-prefixed cpp. Let's copy the un-prefixed tool +# to prefix-tool and delete the un-prefixed one to get back ct-ng behaviour +for tool in gcc g++ gfortran cpp gcc-ar gcc-nm gcc-ranlib c++; do + if [ -f ${PREFIX}/bin/${tool}${EXEEXT} ]; then + if [ ! -f ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ]; then + cp ${PREFIX}/bin/${tool}${EXEEXT} ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} + fi + rm ${PREFIX}/bin/${tool}${EXEEXT} + fi +done diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d03f46ee81c2daee15e45ed5cfec75271e09891e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/meta.yaml @@ -0,0 +1,775 @@ +{% set version = gcc_version %} +{% set build_num = 7 %} + +{% if gcc_maj_ver is not defined %} +{% set gcc_maj_ver = 15 %} +{% endif %} + +# libgcc-devel is a noarch: generic package that is built for +# cross-compilers as well. Instead of skipping for cross-compilers, +# let's prioritize the native compilers package +{% if target_platform == cross_target_platform %} +{% set libgcc_devel_build_num = build_num + 100 %} +{% else %} +{% set libgcc_devel_build_num = build_num %} +{% endif %} + +{% if cross_target_platform is not defined %} +{% set cross_target_platform = "linux-64" %} +{% endif %} + +package: + name: gcc_compilers + version: {{ version }} + +source: + - url: + - https://ftp.gnu.org/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 # [gcc_version == "15.2.0"] + sha256: ace8b8b0dbfe6abfc22f821cb093e195aa5498b7ccf7cd23e4424b9f14afed22 # [gcc_version == "14.3.0"] + sha256: bf0baf3e570c9c74c17c8201f0196c6924b4bd98c90e69d6b2ac0cd823f33bbc # [gcc_version == "13.4.0"] + patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch # [gcc_maj_ver != 13] + {% if cross_target_platform.startswith("linux-") %} + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch # [gcc_maj_ver != 13] + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + {% else %} + # for GCC 15: https://github.com/msys2/MINGW-packages/tree/f59921184b35858d4ceb91679578de0d62475cbf/mingw-w64-gcc + # for GCC 14: https://github.com/msys2/MINGW-packages/tree/331bf945d21af562d228ed46bda21c8272d1e76e/mingw-w64-gcc + # for GCC 13: https://github.com/msys2/MINGW-packages/tree/4f1262b4e1072632eccf0958764f90d890b832ac/mingw-w64-gcc + - patches/mingw/{{ gcc_maj_ver }}/0002-Relocate-libintl.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch + - patches/mingw/{{ gcc_maj_ver }}/0005-Windows-Don-t-ignore-native-system-header-dir.patch + - patches/mingw/{{ gcc_maj_ver }}/0006-Windows-New-feature-to-allow-overriding.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0007-Build-EXTRA_GNATTOOLS-for-Ada.patch + - patches/mingw/{{ gcc_maj_ver }}/0008-Prettify-linking-no-undefined.patch + - patches/mingw/{{ gcc_maj_ver }}/0011-Enable-shared-gnat-implib.patch + - patches/mingw/{{ gcc_maj_ver }}/0012-Handle-spaces-in-path-for-default-manifest.patch + - patches/mingw/{{ gcc_maj_ver }}/0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch + - patches/mingw/{{ gcc_maj_ver }}/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch + - patches/mingw/{{ gcc_maj_ver }}/0021-PR14940-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch # [gcc_maj_ver != 15] + - patches/mingw/{{ gcc_maj_ver }}/0140-gcc-diagnostic-color.patch + - patches/mingw/{{ gcc_maj_ver }}/0200-add-m-no-align-vector-insn-option-for-i386.patch + - patches/mingw/{{ gcc_maj_ver }}/0300-override-builtin-printf-format.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2000-enable-rust.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2001-fix-building-rust-on-mingw-w64.patch + - patches/mingw/{{ gcc_maj_ver }}/2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/9002-native-tls.patch # [gcc_maj_ver == 15] + {% endif %} + +build: + number: {{ build_num }} + skip: True # [win] + skip: true # [not (linux or win) or (win and cross_target_platform != "win-64")] + detect_binary_files_with_prefix: false + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + +requirements: + build: + # Build dependencies are installed in setup_compilers.sh due to + # conda-build bugs + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + +outputs: + - name: libgcc-devel_{{ cross_target_platform }} + script: install-libgcc-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/crtbegin.o + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc_eh.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc.a + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + {% endif %} + about: + summary: The GNU C development libraries and object files + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-devel_{{ cross_target_platform }} + script: install-libstdc++-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++fs.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libsupc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/include/c++/cstdio + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libstdc++.so + {% else %} + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.dll.a + {% endif %} + about: + summary: The GNU C++ headers and development libraries + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc_impl_{{ cross_target_platform }} + script: install-gcc.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - '*' + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgomp", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + run: + - binutils_impl_{{ cross_target_platform }} >={{ binutils_version }} + - {{ pin_subpackage("libgcc-devel_" ~ cross_target_platform, exact=True) }} + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + # libstdcxx is a runtime dep of gcc because LTO requires it. + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgomp", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgcc >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + files: + - tests + commands: + - echo {{ c_stdlib }} + - echo {{ c_stdlib_version }} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.so # [target_platform == cross_target_platform] + - test `readlink ${PREFIX}/{{ triplet }}/lib/libgomp.so` == "../../lib/libgomp.so" # [target_platform == cross_target_platform] + - test -f ${PREFIX}/bin/{{ triplet }}-gcc + - test -f ${PREFIX}/bin/{{ triplet }}-cpp + - test ! -f ${PREFIX}/bin/gcc + - test ! -f ${PREFIX}/bin/cpp + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -march=native # [target_platform == cross_target_platform and (x86_64 or s390x)] + # This test does not work well with QEMU + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -mcpu=native # [target_platform == cross_target_platform and (not x86_64 and not s390x and not ppc64le)] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -fsanitize=address # [cross_target_platform != "win-64"] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v # [cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -v && ./c_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -Wl,-rpath,/foo && {{ triplet }}-readelf -d c_aligned | grep RPATH | grep "/foo:${PREFIX}/lib" # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall tests/hello_world.c -c -o hello_world.o -v + - ${CC} -Wall hello_world.o -o hello_world -v + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + - test -f ${PREFIX}/{{ triplet }}/lib/libsanitizer.spec + - test -f ${PREFIX}/{{ triplet }}/lib/libasan_preinit.o + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libquadmath.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgomp.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.spec + about: + summary: GNU C Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + track_features: # [not with_conda_specs] + - gcc_no_conda_specs # [not with_conda_specs] + requirements: + host: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + run: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - conda-gcc-specs # [with_conda_specs] + test: + commands: + - ${PREFIX}/bin/gcc -v + - ${PREFIX}/bin/gcov -v + about: + summary: GNU C native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gcc-no-conda-specs + build: + skip: true # [with_conda_specs] + requirements: + run: + - gcc + run_constrained: + - conda-gcc-specs <0.0a0 + test: + commands: + - gcc --version + + - name: conda-gcc-specs + script: install-conda-specs.sh + build: + number: {{ build_num }} + skip: true # [cross_target_platform != target_platform] + detect_binary_files_with_prefix: false + requirements: + build: + run: + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, max_pin='x.x.x.x') }} + test: + files: + - tests + commands: + - specdir=$PREFIX/lib/gcc/{{ triplet }}/{{ gcc_version }} + - test -f $specdir/conda.specs + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - echo | ${CC} -E -v -x c - |& grep '^Reading specs from' | awk '{print $NF}' | xargs readlink -e | awk -v ORS= '{print $1":"}' | grep "${specdir}/specs:${specdir}/conda.specs:" + - cp tests/libhowdy.h $PREFIX/include/ + - ${CC} -shared -fpic -o $PREFIX/lib/libhowdy.so tests/libhowdy.c + - ${CC} -o howdy-dso tests/howdy-dso.c -lhowdy + - ./howdy-dso + - grep RPATH <({{ triplet }}-readelf -d howdy-dso) + - "! grep RUNPATH <({{ triplet }}-readelf -d howdy-dso)" + - ${CC} -Wl,-enable-new-dtags -o howdy-dso-runpath tests/howdy-dso.c -lhowdy + - ./howdy-dso-runpath + - "! grep RPATH <({{ triplet }}-readelf -d howdy-dso-runpath)" + - grep RUNPATH <({{ triplet }}-readelf -d howdy-dso-runpath) + - echo | ${CC} -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/,/^End of search/ {print}' | tail -n2 | head -n1 | grep "$PREFIX/include" + - echo | ${CC} -isystem "$PREFIX/include" -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/, /^End of search/ {print}' | head -n2 | tail -n1 | grep "$PREFIX/include" + + about: + summary: conda-specific specfile for GNU C/C++ Compiler + description: | + When installed, this optional package provides a specfile that + directs gcc (and g++ or gfortran) to automatically: + * search for includes in $PREFIX/include + * link libraries in $PREFIX/lib + * set RPATH to $PREFIX/lib + * use RPATH instead of the newer RUNPATH + This package is intended to aid usability of the compiler + toolchain as a replacement for system-installed compilers. + It should not be used in recipes. Use the 'compiler()' + jinja function as described on + https://conda-forge.org/docs/maintainer/knowledge_base.html#dep-compilers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + doc_url: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html + + - name: gxx_impl_{{ cross_target_platform }} + script: install-g++.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + run: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + - {{ pin_subpackage("libstdcxx-devel_" ~ cross_target_platform, exact=True) }} + # for C++20 chrono support + - tzdata + run_exports: + # impose this requirement across the build/host boundary + strong: + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - strace_{{ cross_target_platform }} + files: + - tests + commands: + - test -f ${PREFIX}/bin/{{ triplet }}-g++ + - CXX=$(${PREFIX}/bin/*-gcc -dumpmachine)-g++ + - ${CXX} -Wall tests/aligned_alloc.cpp -c -o cpp_aligned.o --std=c++17 # [cross_target_platform != "win-64"] + - ${CXX} -Wall cpp_aligned.o -o cpp_aligned --std=c++17 && ./cpp_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CXX} -Wall tests/hello_world.cpp -c -o hello_world.o --std=c++17 + - ${CXX} -Wall hello_world.o -o hello_world --std=c++17 + + # test tzdb integration + {% if gcc_maj_ver|int >= 14 %} + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb-override.cpp -c -o tzdb-override.o + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb.cpp -c -o tzdb.o + {% if target_platform == cross_target_platform %} + - ${CXX} tzdb-override.o -o tzdb-override && ./tzdb-override + - ${CXX} tzdb.o -o tzdb && ./tzdb + - $PREFIX/usr/bin/strace ./tzdb 2>&1 | grep ${CONDA_PREFIX}/lib/../share/zoneinfo/tzdata.zi + # also test without any environment activation + - unset PREFIX + - unset CONDA_PREFIX + - ./tzdb + {% endif %} + {% endif %} + about: + summary: GNU C++ Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gxx + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/g++ -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU C++ native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gfortran_impl_{{ cross_target_platform }} + script: install-gfortran.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + # For cpp and crt{i,n}.o + - gcc_impl_{{ cross_target_platform }} >={{ gcc_version }} + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname, max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgfortran{{ libgfortran_soname }} {{ gcc_version }}.* + - libgcc >={{ gcc_version }} + test: + requires: + - cmake >=3.11,<4 # [x86_64 or aarch64 or ppc64le] + - make + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + commands: + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.dll.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.a + - test -f ${PREFIX}/bin/{{ triplet }}-gfortran + - find $PREFIX/lib -iname omp_lib.mod | grep '.' + - find $PREFIX/lib -iname omp_lib.h | grep '.' + - find $PREFIX/lib -iname ISO_Fortran_binding.h | grep '.' + - echo {{ gcc_maj_ver }} + - pushd tests/fortomp + - sh test_fort.sh # [target_platform == cross_target_platform and (x86_64 or aarch64 or ppc64le)] + files: + - tests/fortomp/* + about: + summary: GNU Fortran Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gfortran + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/gfortran -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU Fortran native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: libstdcxx + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libstdcxx-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libstdc++.so + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libsanitizer + target: {{ cross_target_platform }} + script: install-libsanitizer.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform or win] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + - libsanitizer {{ gcc_version }} + overlinking_ignore_patterns: + - "lib/libtsan.so.*" + - "lib/libasan.so.*" + - "lib/liblsan.so.*" + - "lib/libhwasan.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - gcc_impl_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libasan.so + - test -f ${PREFIX}/lib/libhwasan.so # [x86_64 or aarch64] + - file ${PREFIX}/bin/{{ triplet }}-gcc + - echo 'void main(){}' | {{ triplet }}-gcc -fsanitize=address -Wl,--fatal-warnings -x c - + about: + summary: The GCC runtime libraries for sanitizers + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgomp + target: {{ cross_target_platform }} + script: install-libgomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + {% if cross_target_platform.startswith("win-") %} + - {{ pin_subpackage("libgomp", max_pin=None) }} + {% endif %} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run_constrained: + - msys2-conda-epoch <0.0a0 # [win] + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver }} + - test ! -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + about: + summary: The GCC OpenMP implementation. + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgcc + target: {{ cross_target_platform }} + script: install-libgcc-no-gomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + rpaths_patcher: patchelf + overlinking_ignore_patterns: + - "lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ pin_subpackage("libgomp", exact=True) }} + - {{ pin_subpackage('_openmp_mutex', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + run_constrained: + - {{ pin_subpackage("libgomp", exact=True) }} + - msys2-conda-epoch <0.0a0 # [win] + # avoid installing incompatible version of old name for this output + - libgcc-ng =={{ version }}=*_{{ build_num }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgcc_s.so + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: _openmp_mutex + script: install-openmp_impl.sh + version: {{ openmp_ver }} + build: + string: 3_gnu + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + requirements: + build: + host: + - {{ pin_subpackage('libgomp', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgomp >=7.5.0 + run_constrained: + # conflict with previous name + - openmp_impl <0.0a0 + - msys2-conda-epoch <0.0a0 # [win] + test: + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: OpenMP Implementation Mutex + license: BSD-3-Clause + license_file: LICENSE + home: https://github.com/conda-forge/ctng-compilers-feedstock + + - name: libgfortran{{ libgfortran_soname }} + target: {{ cross_target_platform }} + script: install-libgfortran.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libgfortran.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + run_constrained: + - libgfortran {{ gcc_version }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran + target: {{ cross_target_platform }} + build: + skip: true # [target_platform != cross_target_platform] + number: {{ build_num }} + requirements: + run: + - {{ pin_subpackage('libgfortran' ~ libgfortran_soname, exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libgfortran-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gdb-pretty-printer + version: {{ gcc_version }} + script: install-gdb-pretty-printer.sh + build: + # skip until gdb 16.3 is on defaults (which is built against GCC 14.3.0) + skip: true + number: {{ build_num }} + ignore_run_exports: # [linux] + - libstdcxx # [linux] + requirements: + host: + - python + run: + - python + - gdb >= 16.3 + - libstdcxx >={{ gcc_version }} + about: + summary: GNU Compiler Collection Python Pretty Printers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + # compatibility outputs for previous naming of the runtime libraries + # with "-ng" suffix; for windows the suffix had never been introduced + {% if not cross_target_platform.startswith("win-") %} + - name: libgcc-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgcc + requirements: + host: + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-ng + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libstdcxx + requirements: + host: + - {{ pin_subpackage("libstdcxx", exact=True) }} + run: + - {{ pin_subpackage("libstdcxx", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgfortran + requirements: + host: + - {{ pin_subpackage('libgfortran', exact=True) }} + run: + - {{ pin_subpackage('libgfortran', exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + {% endif %} + +about: + summary: GNU Compiler Collection + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + license_file: + - COPYING + - COPYING.LIB + - COPYING3 + - COPYING3.LIB + +extra: + feedstock-name: ctng-compilers-feedstock + recipe-maintainers: + - timsnyder + - xhochy + - isuruf + - beckermr diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e6ea6afa6429337186944117011253d9be4e64f --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch @@ -0,0 +1,23 @@ +From 10cf9f22dcb62db55cd2e9cbc587e2ab35a88889 Mon Sep 17 00:00:00 2001 +From: Tim Snyder +Date: Tue, 29 Mar 2022 22:33:27 +0000 +Subject: [PATCH 1/4] allow % commands in main specfile + +--- + gcc/gcc.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9f1f545dc..28b947c7afd 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -2392,7 +2392,8 @@ read_specs (const char *filename, bool main_p, bool user_p) + /* Is this a special command that starts with '%'? */ + /* Don't allow this for the main specs file, since it would + encourage people to overwrite it. */ +- if (*p == '%' && !main_p) ++ /* ::conda-forge:: allow use of commands in main specs */ ++ if (*p == '%') + { + p1 = p; + while (*p && *p != '\n') diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch new file mode 100644 index 0000000000000000000000000000000000000000..e63a7f8389e8f3c3e60994356076261b033c5fb8 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch @@ -0,0 +1,113 @@ +From 92dc5e74592f57dbc9c2b421e2e348d88d3439f6 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 21 Jun 2024 12:41:07 +1100 +Subject: [PATCH 2/4] patch zoneinfo_dir_override to point to our tzdata + +--- + libstdc++-v3/src/c++20/tzdb.cc | 78 ++++++++++++++++++++++++++++------ + 1 file changed, 65 insertions(+), 13 deletions(-) + +diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc +index 72f20e7f828..8d4feb99902 100644 +--- a/libstdc++-v3/src/c++20/tzdb.cc ++++ b/libstdc++-v3/src/c++20/tzdb.cc +@@ -37,8 +37,12 @@ + #include // mutex + #include // filesystem::read_symlink + +-#ifndef _AIX +-# include // getenv ++#if defined(__linux__) ++# include // dladdr ++# include // free, malloc, realpath ++# include // memcpy, strlen ++#else defined(_WIN32) ++# include + #endif + + #if defined __GTHREADS && ATOMIC_POINTER_LOCK_FREE == 2 +@@ -64,25 +68,73 @@ + + namespace __gnu_cxx + { +-#ifdef _AIX +- // Cannot override weak symbols on AIX. +- const char* (*zoneinfo_dir_override)() = nullptr; +-#else +- [[gnu::weak]] const char* zoneinfo_dir_override(); +- +-#if defined(__APPLE__) || defined(__hpux__) \ +- || (defined(__VXWORKS__) && !defined(__RTP__)) +- // Need a weak definition for Mach-O et al. + [[gnu::weak]] const char* zoneinfo_dir_override() + { ++#ifdef _GLIBCXX_SHARED ++ // get path to library we're in, to determine our location relative to $PREFIX; ++ // with help from the MIT-licensed https://github.com/gpakosz/whereami ++ void* addr = __builtin_extract_return_addr(__builtin_return_address(0)); ++ char* this_lib; ++ int i; ++ // is included through ++ static std::string tz_dir; ++ if (!tz_dir.empty()) { ++ return tz_dir.c_str(); ++ } ++#ifdef _WIN32 ++ // we're in %PREFIX%\Library\bin\libstdc++-6.dll ++# define TO_PREFIX "/../.." ++ // needs single quotes for character (not string) literal ++# define PATH_SEP '\\' ++ wchar_t buffer[MAX_PATH]; ++ HMODULE hm = NULL; ++ // non-zero return means success ++ if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | ++ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, ++ (LPCSTR) addr, &hm)) { ++ // returns length of string (not counting null byte), see ++ // https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#return-value ++ DWORD total_length = GetModuleFileNameW(hm, buffer, sizeof(buffer)); ++ if (total_length) { ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, buffer, total_length); ++#else ++ // we're in $PREFIX/lib/libstdcxx.so ++# define TO_PREFIX "/.." ++# define PATH_SEP '/' ++ char buffer[PATH_MAX]; ++ Dl_info info; ++ ++ if (dladdr(addr, &info)) { ++ char* resolved = realpath(info.dli_fname, buffer); ++ if (resolved) { ++ int total_length = (int)strlen(resolved); ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, resolved, total_length); ++#endif ++ ++ for (i = (int)total_length - 1; i >= 0; --i) { ++ if (this_lib[i] == PATH_SEP) { ++ // set to null byte so the string ends before the basename ++ this_lib[i] = '\0'; ++ break; ++ } ++ } ++ tz_dir = {this_lib}; ++ tz_dir += TO_PREFIX; ++ tz_dir += "/share/zoneinfo"; ++ // std::string constructor for tz_dir deep-copies ++ free(this_lib); ++ return tz_dir.c_str(); ++ } ++ } ++#endif // _GLIBCXX_SHARED + #ifdef _GLIBCXX_ZONEINFO_DIR + return _GLIBCXX_ZONEINFO_DIR; + #else + return nullptr; + #endif + } +-#endif +-#endif + } + + #if ! defined _GLIBCXX_ZONEINFO_DIR && ! defined _GLIBCXX_STATIC_TZDATA diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch new file mode 100644 index 0000000000000000000000000000000000000000..a17bf01c996d5181529f52f35b2df040463adbe4 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch @@ -0,0 +1,40 @@ +From c54fd2dea14134d3e51c17ca5442e0ae2dc16462 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 15 Jul 2024 19:16:05 +1100 +Subject: [PATCH 3/4] add `-ldl` to libstdc___la_LDFLAGS + +we want to link static-only here, to avoid having to add +`-ldl` everytime something links against libstdc++.so + +Co-Authored-By: Isuru Fernando +--- + libstdc++-v3/src/Makefile.am | 2 +- + libstdc++-v3/src/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am +index 37ba1491dea..5b69f43ecd8 100644 +--- a/libstdc++-v3/src/Makefile.am ++++ b/libstdc++-v3/src/Makefile.am +@@ -161,7 +161,7 @@ libstdc___darwin_rpath += -Wl,-rpath,@loader_path + endif + + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + +diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in +index 1bdf0daa88f..ab28e14804e 100644 +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -566,7 +566,7 @@ libstdc___la_DEPENDENCIES = \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wc,-nodefaultrpaths \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wl,-rpath,@loader_path + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + @GLIBCXX_LDBL_ALT128_COMPAT_FALSE@@GLIBCXX_LDBL_COMPAT_TRUE@LTCXXCOMPILE64 = $(LTCXXCOMPILE) diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch new file mode 100644 index 0000000000000000000000000000000000000000..07a361cd6d709849c78bba0ece60ff63d8c2295e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch @@ -0,0 +1,57 @@ +From 86369ec6c37896394546f3b01f9c447c4f4188ae Mon Sep 17 00:00:00 2001 +From: Nehal J Wani +Date: Tue, 12 Jun 2018 05:26:24 +0000 +Subject: [PATCH 4/4] Hardcode HAVE_ALIGNED_ALLOC=1 in libstdc++-v3/configure + +--- + libstdc++-v3/configure | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 18053ab7eae..44b6a72f775 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -26405,6 +26405,11 @@ _ACEOF + fi + done + ++# The check above works only if aligned_alloc is present as a symbol in libc.so ++# Since we provide a header only implementation, override the value here ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + + # For iconv support. + +@@ -38403,6 +38408,9 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + ;; + + *-fuchsia*) +@@ -42318,6 +42326,10 @@ fi + done + + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-mingw32*) + +@@ -45924,6 +45936,10 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-qnx6.1* | *-qnx6.2*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/setup_compiler.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/setup_compiler.sh new file mode 100644 index 0000000000000000000000000000000000000000..dcdd387ae719e4341ae316205f920118cd4b1a45 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/setup_compiler.sh @@ -0,0 +1,48 @@ +#!/bin/bash +if [[ ! -d $SRC_DIR/cf-compilers ]]; then + extra_pkgs=() + if [[ "$build_platform" != "$target_platform" ]]; then + # we need a compiler to target cross_target_platform. + # when build_platform == target_platform, the compiler + # just built can be used. + # when build_platform != target_platform, the compiler + # just built cannot be used, hence we need one that + # can be used. + extra_pkgs+=( + "gcc_impl_${cross_target_platform}=${gcc_version}" + "gxx_impl_${cross_target_platform}=${gcc_version}" + "gfortran_impl_${cross_target_platform}=${gcc_version}" + ) + fi + # Remove conda-forge/label/sysroot-with-crypt when GCC < 14 is dropped + conda create -p $SRC_DIR/cf-compilers --yes --quiet \ + "binutils_impl_${build_platform}" \ + "gcc_impl_${build_platform}" \ + "gxx_impl_${build_platform}" \ + "gfortran_impl_${build_platform}" \ + "binutils_impl_${target_platform}=${binutils_version}" \ + "gcc_impl_${target_platform}" \ + "gxx_impl_${target_platform}" \ + "gfortran_impl_${target_platform}" \ + "${c_stdlib}_${target_platform}=${c_stdlib_version}" \ + "binutils_impl_${cross_target_platform}=${binutils_version}" \ + "${cross_target_stdlib}_${cross_target_platform}=${cross_target_stdlib_version}" \ + make \ + ${extra_pkgs[@]} +fi + +export PATH=$SRC_DIR/cf-compilers/bin:$PATH +export BUILD_PREFIX=$SRC_DIR/cf-compilers + +if [[ "$target_platform" == "win-"* && "${PREFIX}" != *Library ]]; then + export PREFIX=${PREFIX}/Library +fi + +source $RECIPE_DIR/get_cpu_arch.sh + +if [[ "$target_platform" == "win-64" ]]; then + EXEEXT=".exe" +else + EXEEXT="" +fi +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.c b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.c new file mode 100644 index 0000000000000000000000000000000000000000..287be94c7340a134a5d9a56ddc0f6c20acc0af74 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) +{ + int *p2 = (int*)aligned_alloc(1024, 1024*sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.cpp b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1379c7547ae63e12433db910d243f159657aa0b6 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/aligned_alloc.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +//#include + +int main(void) +{ + /// int *p2 = (int*)memalign(1024, 1024 * sizeof *p2); + int *p2; + int err = posix_memalign((void**)&p2, 1024, sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); + p2 = (int*)std::aligned_alloc(1024, 1); + printf("1024-byte aligned addr: %p\n", (void*)p2); + std::free(p2); + p2 = (int*)aligned_alloc(1024, 1024); + printf("1024-byte aligned addr: %p\n", (void*)p2); +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/CMakeLists.txt b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..491a48b42cb3ddfef5f8541f8db848e0ba844f84 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(fortomp + LANGUAGES Fortran) + +find_package(OpenMP REQUIRED) diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/test_fort.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/test_fort.sh new file mode 100644 index 0000000000000000000000000000000000000000..75731b653df023e75c4d2b73b2c345a3510faad9 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/fortomp/test_fort.sh @@ -0,0 +1,11 @@ +GFORTRAN=$(${PREFIX}/bin/*-gcc -dumpmachine)-gfortran +FFLAGS="-fopenmp -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe" + +cmake \ + -H${SRC_DIR} \ + -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_Fortran_COMPILER=${GFORTRAN} \ + -DCMAKE_Fortran_FLAGS="${FFLAGS}" \ + . diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.c b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.c new file mode 100644 index 0000000000000000000000000000000000000000..f6054fde81f8dfa4882cef918c408fa6b7255c3e --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.c @@ -0,0 +1,5 @@ +#include + +int main() { + printf("hello world!\n"); +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.cpp b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..585eea4cee5b1176fd28267f3e27dbdb344fd31f --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/hello_world.cpp @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + std::cout << "hello world!" << std::endl; +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/howdy-dso.c b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/howdy-dso.c new file mode 100644 index 0000000000000000000000000000000000000000..ea47ce0a03e061a965fc1e2cdaf310c038d4b44d --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/howdy-dso.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + howdy(); + return 0; +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.c b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.c new file mode 100644 index 0000000000000000000000000000000000000000..6cd0dc522a8e4485f8173321a3dff2b21f079415 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.c @@ -0,0 +1,5 @@ +#include + +void howdy(void) { + printf("Howdy Y'all!\n"); +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.h b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.h new file mode 100644 index 0000000000000000000000000000000000000000..6234950e5a3ce9ff0209513f328d0ecfc71bac99 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/libhowdy.h @@ -0,0 +1,6 @@ +#ifndef _LIBHOWDY_H +#define _LIBHOWDY_H + +extern void howdy(void); + +#endif diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb-override.cpp b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb-override.cpp new file mode 100644 index 0000000000000000000000000000000000000000..73284e6245e5774322d67924db2f0907e5a6d668 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb-override.cpp @@ -0,0 +1,29 @@ +// We are using a weak symbol in linux and windows using a patch +// while upstream only has the definition and no implementation. +// Check that overriding works. + +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +static bool override_used = false; + +namespace __gnu_cxx +{ + const char* zoneinfo_dir_override() { + override_used = true; + return "./"; + } +} + +using namespace std::chrono; + +int main() +{ + auto &a = get_tzdb(); + return !override_used; +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb.cpp b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ccf3f4d44cb32a75a7f9e0d4b8876e9d76693ca --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/tests/tzdb.cpp @@ -0,0 +1,95 @@ +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/util/testsuite_hooks.h#L61-L70 +#define VERIFY(fn) \ + do \ + { \ + if (! (fn)) \ + { \ + __builtin_fprintf(stderr, \ + "%s:%d: %s: Assertion '%s' failed.\n", \ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \ + __builtin_abort(); \ + } \ + } while (false) + + +using namespace std::chrono; + +void +test_version() +{ + const tzdb& db = get_tzdb(); + VERIFY( &db == &get_tzdb_list().front() ); + + const char* func; + try { + func = "remote_version"; + VERIFY( db.version == remote_version() ); + func = "reload_tzdb"; + const tzdb& reloaded = reload_tzdb(); + if (reloaded.version == db.version) + VERIFY( &reloaded == &db ); + } catch (const std::exception&) { + std::printf("std::chrono::%s() failed\n", func); + // on exception, we fail louder than the upstream reference test + exit(1); + } +} + +void +test_current() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.current_zone(); + VERIFY( tz == std::chrono::current_zone() ); +} + +void +test_locate() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.locate_zone("GMT"); + VERIFY( tz != nullptr ); + VERIFY( tz->name() == "Etc/GMT" ); + VERIFY( tz == std::chrono::locate_zone("GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT+0") ); + + VERIFY( db.locate_zone(db.current_zone()->name()) == db.current_zone() ); +} + +void +test_all_zones() +{ + const tzdb& db = get_tzdb(); + + for (const auto& zone : db.zones) + VERIFY( locate_zone(zone.name())->name() == zone.name() ); + + for (const auto& link : db.links) + VERIFY( locate_zone(link.name()) == locate_zone(link.target()) ); +} + +void +test_load_leapseconds() +{ + const auto& db = get_tzdb(); + + // this is correct as of tzdata 2024a + VERIFY( db.leap_seconds.size() == 27 ); +} + +int main() +{ + test_version(); + test_current(); + test_locate(); + test_load_leapseconds(); +} diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config new file mode 100644 index 0000000000000000000000000000000000000000..1c51f52fd306d3a08ada254a04bb29b307ac7399 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config @@ -0,0 +1,295 @@ +# +# Automatically generated make config: don't edit +# Version: 0.9.32-git +# Fri Jul 9 22:31:59 2010 +# +# TARGET_alpha is not set +TARGET_arm=y +# TARGET_avr32 is not set +# TARGET_bfin is not set +# TARGET_cris is not set +# TARGET_e1 is not set +# TARGET_frv is not set +# TARGET_h8300 is not set +# TARGET_hppa is not set +# TARGET_i386 is not set +# TARGET_i960 is not set +# TARGET_ia64 is not set +# TARGET_m68k is not set +# TARGET_microblaze is not set +# TARGET_mips is not set +# TARGET_nios is not set +# TARGET_nios2 is not set +# TARGET_powerpc is not set +# TARGET_sh is not set +# TARGET_sh64 is not set +# TARGET_sparc is not set +# TARGET_v850 is not set +# TARGET_vax is not set +# TARGET_x86_64 is not set +# TARGET_xtensa is not set +# TARGET_c6x is not set + +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_CORTEX_M3 is not set +# CONFIG_ARM_CORTEX_M1 is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set + +# COMPILE_IN_THUMB_MODE is not set +USE_BX=y + +TARGET_SUBARCH="" +# +# Target Architecture Features and Options +# +TARGET_ARCH="arm" +FORCE_OPTIONS_FOR_ARCH=y +# +# Using ELF file format +# +ARCH_LITTLE_ENDIAN=y +# ARCH_BIG_ENDIAN is not set +ARCH_WANTS_LITTLE_ENDIAN=y +# ARCH_WANTS_BIG_ENDIAN is not set +ARCH_HAS_MMU=y +ARCH_USE_MMU=y +UCLIBC_HAS_FLOATS=y +UCLIBC_HAS_FPU=n +DO_C99_MATH=y +# DO_XSI_MATH is not set +# UCLIBC_HAS_FENV is not set +UCLIBC_HAS_LONG_DOUBLE_MATH=y +HAVE_DOT_CONFIG=y + +# +# General Library Settings +# +# HAVE_NO_PIC is not set +DOPIC=y +# ARCH_HAS_NO_SHARED is not set +# ARCH_HAS_NO_LDSO is not set +HAVE_SHARED=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +LDSO_LDD_SUPPORT=y +# LDSO_CACHE_SUPPORT is not set +LDSO_PRELOAD_ENV_SUPPORT=y +# LDSO_PRELOAD_FILE_SUPPORT is not set +# LDSO_STANDALONE_SUPPORT is not set +# LDSO_PRELINK_SUPPORT is not set +# UCLIBC_STATIC_LDCONFIG is not set +LDSO_RUNPATH=y +LDSO_SEARCH_INTERP_PATH=y +LDSO_LD_LIBRARY_PATH=y +# LDSO_NO_CLEANUP is not set +UCLIBC_CTOR_DTOR=y +# LDSO_GNU_HASH_SUPPORT is not set +# HAS_NO_THREADS is not set +UCLIBC_HAS_SYSLOG=y +UCLIBC_HAS_LFS=y +# MALLOC is not set +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MALLOC_GLIBC_COMPAT=y +UCLIBC_DYNAMIC_ATEXIT=y +# COMPAT_ATEXIT is not set +UCLIBC_SUSV3_LEGACY=y +# UCLIBC_SUSV3_LEGACY_MACROS is not set +UCLIBC_SUSV4_LEGACY=y +# UCLIBC_STRICT_HEADERS is not set +# UCLIBC_HAS_STUBS is not set +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS___PROGNAME=y +UCLIBC_HAS_PTY=y +ASSUME_DEVPTS=y +UNIX98PTY_ONLY=y +UCLIBC_HAS_GETPT=y +UCLIBC_HAS_LIBUTIL=y +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_TZ_FILE_PATH="/etc/TZ" +UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y + +# +# Advanced Library Settings +# +UCLIBC_PWD_BUFFER_SIZE=256 +UCLIBC_GRP_BUFFER_SIZE=256 + +# +# Support various families of functions +# +UCLIBC_LINUX_MODULE_26=y +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_SPECIFIC=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_BSD_ERR=y +# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set +# UCLIBC_NTP_LEGACY is not set +# UCLIBC_SV4_DEPRECATED is not set +UCLIBC_HAS_REALTIME=y +UCLIBC_HAS_ADVANCED_REALTIME=y +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_XATTR=y +UCLIBC_HAS_PROFILING=y +UCLIBC_HAS_CRYPT_IMPL=y +# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set +# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_IPV4=y +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_RPC=n +UCLIBC_HAS_FULL_RPC=n +UCLIBC_HAS_REENTRANT_RPC=n +UCLIBC_USE_NETLINK=y +UCLIBC_SUPPORT_AI_ADDRCONFIG=y +# UCLIBC_HAS_BSD_RES_CLOSE is not set +UCLIBC_HAS_COMPAT_RES_STATE=y +# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set +UCLIBC_HAS_RESOLVER_SUPPORT=y +UCLIBC_HAS_LIBRESOLV_STUB=y +UCLIBC_HAS_LIBNSL_STUB=y + +# +# String and Stdio Support +# +# UCLIBC_HAS_STRING_GENERIC_OPT is not set +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_CTYPE_TABLES=y +UCLIBC_HAS_CTYPE_SIGNED=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_WCHAR=y +UCLIBC_HAS_LOCALE=n +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +# USE_OLD_VFPRINTF is not set +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +UCLIBC_HAS_STDIO_BUFSIZ_4096=y +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +# UCLIBC_HAS_STDIO_GETC_MACRO is not set +# UCLIBC_HAS_STDIO_PUTC_MACRO is not set +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +UCLIBC_HAS_PRINTF_M_SPEC=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_SYS_ERRLIST is not set +UCLIBC_HAS_SIGNUM_MESSAGES=y +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_GNU_GETOPT=y +# UCLIBC_HAS_GNU_GETSUBOPT is not set + +# +# Big and Tall +# +UCLIBC_HAS_REGEX=y +# UCLIBC_HAS_REGEX_OLD is not set +UCLIBC_HAS_FNMATCH=y +# UCLIBC_HAS_FNMATCH_OLD is not set +# UCLIBC_HAS_WORDEXP is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y +# UCLIBC_HAS_FTS is not set +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_GLOB=y +UCLIBC_HAS_UTMPX=y + +# +# Library Installation Options +# +RUNTIME_PREFIX="/" +DEVEL_PREFIX="/usr/" +MULTILIB_DIR="lib" +HARDWIRED_ABSPATH=y + +# +# Security options +# +# UCLIBC_BUILD_PIE is not set +# UCLIBC_HAS_ARC4RANDOM is not set +# HAVE_NO_SSP is not set +UCLIBC_HAS_SSP=y +# UCLIBC_HAS_SSP_COMPAT is not set +# SSP_QUICK_CANARY is not set +PROPOLICE_BLOCK_ABRT=y +# PROPOLICE_BLOCK_SEGV is not set +# UCLIBC_BUILD_SSP is not set +UCLIBC_BUILD_RELRO=y +UCLIBC_BUILD_NOW=y +UCLIBC_BUILD_NOEXECSTACK=y + +# +# uClibc development/debugging options +# +UCLIBC_EXTRA_CFLAGS="" +# DODEBUG is not set +# DODEBUG_PT is not set +DOSTRIP=y +# DOASSERTS is not set +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +# UCLIBC_MALLOC_DEBUGGING is not set +# UCLIBC_HAS_BACKTRACE is not set +WARNINGS="-Wall" +# EXTRA_WARNINGS is not set +# DOMULTI is not set +# UCLIBC_MJN3_ONLY is not set +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set +# CONFIG_ARM_OABI is not set +CONFIG_ARM_EABI=y +UCLIBC_HAS_THREADS=y +# LINUXTHREADS is not set +# LINUXTHREADS_NEW is not set +# LINUXTHREADS_OLD is not set +UCLIBC_HAS_THREADS_NATIVE=y +# PTHREADS_DEBUG_SUPPORT is not set diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config.minimal b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config.minimal new file mode 100644 index 0000000000000000000000000000000000000000..af041eabf04383938f4857a8ec85a6834b5c07b5 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/uclibc.config.minimal @@ -0,0 +1,2 @@ +UCLIBC_HAS_STDIO_GETC_MACRO=n +UCLIBC_HAS_STDIO_PUTC_MACRO=n diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/yum_requirements.txt b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/yum_requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1017f133398ac40e5408f2f480b14d422da8b632 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/recipe/parent/yum_requirements.txt @@ -0,0 +1,12 @@ +wget +m4 +help2man +patch +gcc-gfortran +gcc-c++ +rsync +sed +findutils +make +file +strace diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/repodata_record.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..4dbb5538da1f82dca69bf3e996979f2683482355 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/repodata_record.json @@ -0,0 +1,21 @@ +{ + "arch": "x86_64", + "build": "h4751f2c_7", + "build_number": 7, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0" + ], + "fn": "libgomp-15.2.0-h4751f2c_7.conda", + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "md5": "82025ed6da944bd419d42d9b1ff116aa", + "name": "libgomp", + "platform": "linux", + "sha256": "835e44371812c91563a00dec8bc98c460f8b9f33f50543244bc8774c446a2172", + "size": 446183, + "subdir": "linux-64", + "timestamp": 1762772542000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libgomp-15.2.0-h4751f2c_7.conda", + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/run_exports.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..8317f7488646f484ede0fae55b47917a1f0a9452 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/run_exports.json @@ -0,0 +1 @@ +{"strong": ["_openmp_mutex >=4.5"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/run_test.sh b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ab1780439ef7ca4f976382d939be1ea0ab91a432 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +test -f ${PREFIX}/lib/libgomp.so.1.0.0 +test ! -f ${PREFIX}/lib/libgomp.so.1 +exit 0 diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/test_time_dependencies.json b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..f9b4fa3ace901164d68b54555c80e7a11512bbbe --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["sysroot_linux-64"] \ No newline at end of file diff --git a/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy new file mode 100644 index 0000000000000000000000000000000000000000..e1b3c69c179dfaff5744ea4bf853e6b0d90c9ef9 --- /dev/null +++ b/miniconda3/pkgs/libgomp-15.2.0-h4751f2c_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy @@ -0,0 +1,73 @@ +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/iconv.h b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/iconv.h new file mode 100644 index 0000000000000000000000000000000000000000..95510bab5bdde8f16ab5f282718e2728267f18aa --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/iconv.h @@ -0,0 +1,243 @@ +/* Copyright (C) 1999-2024 Free Software Foundation, Inc. + This file is part of the GNU LIBICONV Library. + + The GNU LIBICONV Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + + The GNU LIBICONV Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU LIBICONV Library; see the file COPYING.LIB. + If not, see . */ + +/* When installed, this file is called "iconv.h". */ + +#ifndef _LIBICONV_H +#define _LIBICONV_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define _LIBICONV_VERSION 0x0112 /* version number: (major<<8) + minor */ +extern int _libiconv_version; /* Likewise */ + +#ifdef __cplusplus +} +#endif + +/* We would like to #include any system header file which could define + iconv_t, in order to eliminate the risk that the user gets compilation + errors because some other system header file includes /usr/include/iconv.h + which defines iconv_t or declares iconv after this file. + But gcc's #include_next is not portable. Thus, once libiconv's iconv.h + has been installed in /usr/local/include, there is no way any more to + include the original /usr/include/iconv.h. We simply have to get away + without it. + The risk that a system header file does + #include "iconv.h" or #include_next "iconv.h" + is small. They all do #include . */ + +/* Define iconv_t ourselves. */ +#undef iconv_t +#define iconv_t libiconv_t +typedef void* iconv_t; + +/* Get size_t declaration. + Get wchar_t declaration if it exists. */ +#include + +/* Get errno declaration and values. */ +#include +/* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS, + have EILSEQ in a different header. On these systems, define EILSEQ + ourselves. */ +#ifndef EILSEQ +#define EILSEQ +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Allocates descriptor for code conversion from encoding ‘fromcode’ to + encoding ‘tocode’. */ +#define iconv_open libiconv_open +extern iconv_t iconv_open (const char* tocode, const char* fromcode); + +/* Converts, using conversion descriptor ‘cd’, at most ‘*inbytesleft’ bytes + starting at ‘*inbuf’, writing at most ‘*outbytesleft’ bytes starting at + ‘*outbuf’. + Decrements ‘*inbytesleft’ and increments ‘*inbuf’ by the same amount. + Decrements ‘*outbytesleft’ and increments ‘*outbuf’ by the same amount. */ +#define iconv libiconv +extern size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft); + +/* Frees resources allocated for conversion descriptor ‘cd’. */ +#define iconv_close libiconv_close +extern int iconv_close (iconv_t cd); + + +#ifdef __cplusplus +} +#endif + + +/* Nonstandard extensions. */ + +#if 1 +#if 0 +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#endif +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* A type that holds all memory needed by a conversion descriptor. + A pointer to such an object can be used as an iconv_t. */ +typedef struct { + void* dummy1[28]; +#if 1 + mbstate_t dummy2; +#endif +} iconv_allocation_t; + +/* Allocates descriptor for code conversion from encoding ‘fromcode’ to + encoding ‘tocode’ into preallocated memory. Returns an error indicator + (0 or -1 with errno set). */ +#define iconv_open_into libiconv_open_into +extern int iconv_open_into (const char* tocode, const char* fromcode, + iconv_allocation_t* resultp); + +/* Control of attributes. */ +#define iconvctl libiconvctl +extern int iconvctl (iconv_t cd, int request, void* argument); + +/* Hook performed after every successful conversion of a Unicode character. */ +typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data); +/* Hook performed after every successful conversion of a wide character. */ +typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data); +/* Set of hooks. */ +struct iconv_hooks { + iconv_unicode_char_hook uc_hook; + iconv_wide_char_hook wc_hook; + void* data; +}; + +/* Fallback function. Invoked when a small number of bytes could not be + converted to a Unicode character. This function should process all + bytes from inbuf and may produce replacement Unicode characters by calling + the write_replacement callback repeatedly. */ +typedef void (*iconv_unicode_mb_to_uc_fallback) + (const char* inbuf, size_t inbufsize, + void (*write_replacement) (const unsigned int *buf, size_t buflen, + void* callback_arg), + void* callback_arg, + void* data); +/* Fallback function. Invoked when a Unicode character could not be converted + to the target encoding. This function should process the character and + may produce replacement bytes (in the target encoding) by calling the + write_replacement callback repeatedly. */ +typedef void (*iconv_unicode_uc_to_mb_fallback) + (unsigned int code, + void (*write_replacement) (const char *buf, size_t buflen, + void* callback_arg), + void* callback_arg, + void* data); +/* Fallback function. Invoked when a number of bytes could not be converted to + a wide character. This function should process all bytes from inbuf and may + produce replacement wide characters by calling the write_replacement + callback repeatedly. */ +typedef void (*iconv_wchar_mb_to_wc_fallback) + (const char* inbuf, size_t inbufsize, + void (*write_replacement) (const wchar_t *buf, size_t buflen, + void* callback_arg), + void* callback_arg, + void* data); +/* Fallback function. Invoked when a wide character could not be converted to + the target encoding. This function should process the character and may + produce replacement bytes (in the target encoding) by calling the + write_replacement callback repeatedly. */ +typedef void (*iconv_wchar_wc_to_mb_fallback) + (wchar_t code, + void (*write_replacement) (const char *buf, size_t buflen, + void* callback_arg), + void* callback_arg, + void* data); +/* Set of fallbacks. */ +struct iconv_fallbacks { + iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback; + iconv_unicode_uc_to_mb_fallback uc_to_mb_fallback; + iconv_wchar_mb_to_wc_fallback mb_to_wc_fallback; + iconv_wchar_wc_to_mb_fallback wc_to_mb_fallback; + void* data; +}; + +/* Surfaces. + The concept of surfaces is described in the 'recode' manual. */ +#define ICONV_SURFACE_NONE 0 +/* In EBCDIC encodings, 0x15 (which encodes the "newline function", see the + Unicode standard, chapter 5) maps to U+000A instead of U+0085. This is + for interoperability with C programs and Unix environments on z/OS. */ +#define ICONV_SURFACE_EBCDIC_ZOS_UNIX 1 + +/* Requests for iconvctl. */ +#define ICONV_TRIVIALP 0 /* int *argument */ +#define ICONV_GET_TRANSLITERATE 1 /* int *argument */ +#define ICONV_SET_TRANSLITERATE 2 /* const int *argument */ +#define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */ +#define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */ +#define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */ +#define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */ +#define ICONV_GET_FROM_SURFACE 7 /* unsigned int *argument */ +#define ICONV_SET_FROM_SURFACE 8 /* const unsigned int *argument */ +#define ICONV_GET_TO_SURFACE 9 /* unsigned int *argument */ +#define ICONV_SET_TO_SURFACE 10 /* const unsigned int *argument */ +#define ICONV_GET_DISCARD_INVALID 11 /* int *argument */ +#define ICONV_SET_DISCARD_INVALID 12 /* const int *argument */ +#define ICONV_GET_DISCARD_NON_IDENTICAL 13 /* int *argument */ +#define ICONV_SET_DISCARD_NON_IDENTICAL 14 /* const int *argument */ + +/* Listing of locale independent encodings. */ +#define iconvlist libiconvlist +extern void iconvlist (int (*do_one) (unsigned int namescount, + const char * const * names, + void* data), + void* data); + +/* Canonicalize an encoding name. + The result is either a canonical encoding name, or name itself. */ +extern const char * iconv_canonicalize (const char * name); + +/* Support for relocatable packages. */ + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +extern void libiconv_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +#ifdef __cplusplus +} +#endif + + +#endif /* _LIBICONV_H */ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/libcharset.h b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/libcharset.h new file mode 100644 index 0000000000000000000000000000000000000000..fcf22748101279e454fd2fefe01908fd8545bce2 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/libcharset.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + The GNU CHARSET Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU CHARSET Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with the GNU CHARSET Library; see the file COPYING.LIB. If not, + see . */ + +#ifndef _LIBCHARSET_H +#define _LIBCHARSET_H + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Support for relocatable packages. */ + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +extern void libcharset_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LIBCHARSET_H */ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/localcharset.h b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/localcharset.h new file mode 100644 index 0000000000000000000000000000000000000000..34ce0adde9bb793f1c1cd5f81b5cc3d2eff08ab1 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/include/localcharset.h @@ -0,0 +1,137 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2000-2003, 2009-2019 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . */ + +#ifndef _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed below. + The result must not be freed; it is statically allocated. The result + becomes invalid when setlocale() is used to change the global locale, or + when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG + is changed; threads in multithreaded programs should not do this. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + +/* About GNU canonical names for character encodings: + + Every canonical name must be supported by GNU libiconv. Support by GNU libc + is also desirable. + + The name is case insensitive. Usually an upper case MIME charset name is + preferred. + + The current list of these GNU canonical names is: + + name MIME? used by which systems + (darwin = Mac OS X, windows = native Windows) + + ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin + ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-3 Y glibc solaris cygwin + ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin + ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-6 Y glibc aix hpux solaris cygwin + ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos + ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos + ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos + ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-14 glibc cygwin + ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin + KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin + KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin + KOI8-T glibc + CP437 dos + CP775 dos + CP850 aix osf dos + CP852 dos + CP855 dos + CP856 aix + CP857 dos + CP861 dos + CP862 dos + CP864 dos + CP865 dos + CP866 freebsd netbsd openbsd darwin dos + CP869 dos + CP874 windows dos + CP922 aix + CP932 aix cygwin windows dos + CP943 aix zos + CP949 osf darwin windows dos + CP950 windows dos + CP1046 aix + CP1124 aix + CP1125 dos + CP1129 aix + CP1131 freebsd darwin + CP1250 windows + CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows + CP1252 aix windows + CP1253 windows + CP1254 windows + CP1255 glibc windows + CP1256 windows + CP1257 windows + GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos + EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin + EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos + EUC-TW glibc aix hpux irix osf solaris netbsd + BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos + BIG5-HKSCS glibc hpux solaris netbsd darwin + GBK glibc aix osf solaris freebsd darwin cygwin windows dos + GB18030 glibc hpux solaris freebsd netbsd darwin + SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin + JOHAB glibc solaris windows + TIS-620 glibc aix hpux osf solaris cygwin zos + VISCII Y glibc + TCVN5712-1 glibc + ARMSCII-8 glibc freebsd netbsd darwin + GEORGIAN-PS glibc cygwin + PT154 glibc netbsd cygwin + HP-ROMAN8 hpux + HP-ARABIC8 hpux + HP-GREEK8 hpux + HP-HEBREW8 hpux + HP-TURKISH8 hpux + HP-KANA8 hpux + DEC-KANJI osf + DEC-HANYU osf + UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos + + Note: Names which are not marked as being a MIME name should not be used in + Internet protocols for information interchange (mail, news, etc.). + + Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications + must understand both names and treat them as equivalent. + */ + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/about.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..fad12daae0ef774459c7bb6a213fbea123f3988a --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/about.json @@ -0,0 +1,184 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "26.1.0", + "conda_version": "26.1.0", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "parent_recipe": { + "name": "libiconv-split", + "path": "/home/task_177149156520949/libiconv-feedstock/recipe", + "version": "1.18" + }, + "pbp_graph_uuid": "a645ec97-1204-48b8-b3a2-b8f08653019a", + "recipe-maintainers": [ + "ocefpaf", + "jakirkham", + "jhamman", + "mingwandroid", + "scopatz" + ], + "remote_url": "https://github.com/AnacondaRecipes/libiconv-feedstock", + "sha": "a42f10c26cf243d7b6722426f4d1965fd7ad84e6", + "task_id": "U0FZCtlBTSK4RiGua7nFww", + "task_run_id": "0" + }, + "home": "https://www.gnu.org/software/libiconv", + "identifiers": [], + "keywords": [], + "license": "LGPL-2.1-only", + "license_file": "COPYING.LIB", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.12.2 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025b h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.7.1 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "libiconv 1.16 h5eee18b_3", + "pthread-stubs 0.3 h0ce48e5_1", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xorg-libxau 1.0.12 h9b100fa_0", + "xorg-libxdmcp 1.1.5 h9b100fa_0", + "xorg-xorgproto 2024.1 h5eee18b_1", + "xz 5.6.4 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxcb 1.17.0 h9b100fa_0", + "libxml2 2.13.8 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.21.3 h8a1dbc1_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.50.2 hb25bd0a_1", + "xorg-libx11 1.8.12 h9b100fa_1", + "patch 2.8 hb25bd0a_0", + "libmamba 2.0.5 haf1ee3a_1", + "python 3.12.11 h22baa00_0", + "menuinst 2.3.0 py312h06a4308_0", + "anaconda-anon-usage 0.7.1 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 25.0.0 py312h06a4308_0", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 4.3.7 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.19.1 py312h06a4308_0", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.12 py312h5eee18b_0", + "setuptools 78.1.1 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.1 pyhc872135_2", + "ruamel.yaml 0.18.10 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "typing-inspection 0.4.0 py312h06a4308_0", + "brotlicffi 1.0.9.2 py312h6a678d5_1", + "cryptography 45.0.3 py312h2ccb017_0", + "pydantic-core 2.33.2 py312hc6f7160_0", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "pydantic 2.11.7 py312h06a4308_0", + "urllib3 2.5.0 py312h06a4308_0", + "requests 2.32.4 py312h06a4308_0", + "conda-package-streaming 0.12.0 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda-anaconda-tos 0.2.1 py312h06a4308_0", + "libsodium 1.0.20 heac8642_0", + "libunistring 1.3 hb25bd0a_0", + "mbedtls 3.5.1 h6a678d5_1", + "openssl 3.0.18 hd6dcaed_0", + "patchelf 0.17.2 h6a678d5_0", + "perl 5.40.2 0_h5eee18b_perl5", + "yaml 0.2.5 h7b6447c_0", + "liblief 0.16.4 h6a678d5_0", + "gettext 0.21.0 hedfda30_2", + "libidn2 2.3.8 hf80d704_0", + "tk 8.6.15 h54e0aa7_0", + "libcurl 8.16.0 heebcbe5_0", + "git 2.51.0 pl5382h000ed5b_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 25.4.0 py312h06a4308_2", + "certifi 2026.01.04 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_1", + "evalidate 2.0.3 py312h06a4308_0", + "filelock 3.20.3 py312h06a4308_0", + "jmespath 1.1.0 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "msgpack-python 1.1.1 py312h6a678d5_0", + "pkginfo 1.12.1.2 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_1", + "py-lief 0.16.4 py312h6a678d5_0", + "python-libarchive-c 5.3 py312h06a4308_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.28.0 py312h498d7c9_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.3 py312h06a4308_0", + "xmltodict 1.0.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.37.0 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.14.3 py312h06a4308_0", + "jsonschema-specifications 2025.9.1 py312h06a4308_0", + "pynacl 1.6.0 py312h2630517_0", + "jsonschema 4.25.1 py312h06a4308_0", + "botocore 1.42.34 py312h06a4308_0", + "s3transfer 0.16.0 py312h06a4308_0", + "boto3 1.42.34 py312h06a4308_0", + "conda 26.1.0 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.7.0 py312h06a4308_1", + "conda-libmamba-solver 25.11.0 pyhdf14ebd_0", + "conda-build 26.1.0 py312h76456e7_0" + ], + "summary": "Provides iconv for systems which don't have one (or that cannot convert from/to Unicode.)", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/files b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..66babce823da3a8dc8a0099c4b25882108951be6 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/files @@ -0,0 +1,51 @@ +include/iconv.h +include/libcharset.h +include/localcharset.h +lib/libcharset.a +lib/libcharset.so +lib/libcharset.so.1 +lib/libcharset.so.1.0.0 +lib/libiconv.a +lib/libiconv.so +lib/libiconv.so.2 +lib/libiconv.so.2.7.0 +share/locale/af/LC_MESSAGES/libiconv.mo +share/locale/be/LC_MESSAGES/libiconv.mo +share/locale/bg/LC_MESSAGES/libiconv.mo +share/locale/ca/LC_MESSAGES/libiconv.mo +share/locale/cs/LC_MESSAGES/libiconv.mo +share/locale/da/LC_MESSAGES/libiconv.mo +share/locale/de/LC_MESSAGES/libiconv.mo +share/locale/el/LC_MESSAGES/libiconv.mo +share/locale/eo/LC_MESSAGES/libiconv.mo +share/locale/es/LC_MESSAGES/libiconv.mo +share/locale/et/LC_MESSAGES/libiconv.mo +share/locale/fi/LC_MESSAGES/libiconv.mo +share/locale/fr/LC_MESSAGES/libiconv.mo +share/locale/ga/LC_MESSAGES/libiconv.mo +share/locale/gl/LC_MESSAGES/libiconv.mo +share/locale/hr/LC_MESSAGES/libiconv.mo +share/locale/hu/LC_MESSAGES/libiconv.mo +share/locale/id/LC_MESSAGES/libiconv.mo +share/locale/it/LC_MESSAGES/libiconv.mo +share/locale/ja/LC_MESSAGES/libiconv.mo +share/locale/ka/LC_MESSAGES/libiconv.mo +share/locale/ko/LC_MESSAGES/libiconv.mo +share/locale/lt/LC_MESSAGES/libiconv.mo +share/locale/nl/LC_MESSAGES/libiconv.mo +share/locale/pl/LC_MESSAGES/libiconv.mo +share/locale/pt_BR/LC_MESSAGES/libiconv.mo +share/locale/rm/LC_MESSAGES/libiconv.mo +share/locale/ro/LC_MESSAGES/libiconv.mo +share/locale/ru/LC_MESSAGES/libiconv.mo +share/locale/sk/LC_MESSAGES/libiconv.mo +share/locale/sl/LC_MESSAGES/libiconv.mo +share/locale/sq/LC_MESSAGES/libiconv.mo +share/locale/sr/LC_MESSAGES/libiconv.mo +share/locale/sv/LC_MESSAGES/libiconv.mo +share/locale/tr/LC_MESSAGES/libiconv.mo +share/locale/uk/LC_MESSAGES/libiconv.mo +share/locale/vi/LC_MESSAGES/libiconv.mo +share/locale/wa/LC_MESSAGES/libiconv.mo +share/locale/zh_CN/LC_MESSAGES/libiconv.mo +share/locale/zh_TW/LC_MESSAGES/libiconv.mo diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/git b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/hash_input.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..a1c49862b64cd1a567f9a85fd515481430e1b7b2 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/hash_input.json @@ -0,0 +1,10 @@ +{ + "libiconv": "1", + "channel_targets": "defaults", + "c_compiler_version": "14.3.0", + "c_compiler": "gcc", + "c_stdlib": "sysroot", + "target_platform": "linux-64", + "c_stdlib_version": "2.28", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/index.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..363edeb29064fe51d6c309475095d5749e2ad3b1 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/index.json @@ -0,0 +1,15 @@ +{ + "arch": "x86_64", + "build": "h75a1612_0", + "build_number": 0, + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14" + ], + "license": "LGPL-2.1-only", + "name": "libiconv", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1771491869505, + "version": "1.18" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/licenses/COPYING.LIB b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/licenses/COPYING.LIB new file mode 100644 index 0000000000000000000000000000000000000000..f6683e74e0f0130f246dbf7054f4cacc88ca84b0 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/licenses/COPYING.LIB @@ -0,0 +1,501 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Moe Ghoul, President of Vice + +That's all there is to it! diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/paths.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..0a3acee66f4b12a803d62721478dd93509b89f40 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/paths.json @@ -0,0 +1,311 @@ +{ + "paths": [ + { + "_path": "include/iconv.h", + "path_type": "hardlink", + "sha256": "e60b919d6ce6474ca5f9866486f5780a0ff3dab951facb8836908dfd486e2e81", + "size_in_bytes": 9663 + }, + { + "_path": "include/libcharset.h", + "path_type": "hardlink", + "sha256": "180d05ba6adb348e150c6973ab795fe422da0b05e09f8ba7c369746ed1901702", + "size_in_bytes": 1510 + }, + { + "_path": "include/localcharset.h", + "path_type": "hardlink", + "sha256": "67f01a81a41eab468313b34fb153aa11fe273b829c529e3a820a3877438d20e4", + "size_in_bytes": 6338 + }, + { + "_path": "lib/libcharset.a", + "path_type": "hardlink", + "sha256": "5e44fa5c5b6bf5c6e623609e8232dfc59c51a43c3281cfde150f4d6579f4ffe9", + "size_in_bytes": 3360 + }, + { + "_path": "lib/libcharset.so", + "path_type": "softlink", + "sha256": "91661436e4660334a574b16919a732d5264728016404117dcdd4e9c24dcb9cd3", + "size_in_bytes": 15624 + }, + { + "_path": "lib/libcharset.so.1", + "path_type": "softlink", + "sha256": "91661436e4660334a574b16919a732d5264728016404117dcdd4e9c24dcb9cd3", + "size_in_bytes": 15624 + }, + { + "_path": "lib/libcharset.so.1.0.0", + "path_type": "hardlink", + "sha256": "91661436e4660334a574b16919a732d5264728016404117dcdd4e9c24dcb9cd3", + "size_in_bytes": 15624 + }, + { + "_path": "lib/libiconv.a", + "path_type": "hardlink", + "sha256": "ebe754408554fbae4af94b706301c68aed998d2ecc1f2bacda83b74f3aa628c4", + "size_in_bytes": 1312114 + }, + { + "_path": "lib/libiconv.so", + "path_type": "softlink", + "sha256": "acf953233d267bba2f7fa051bf3a1d39ca04c766735556a941283c4029c045ae", + "size_in_bytes": 1178824 + }, + { + "_path": "lib/libiconv.so.2", + "path_type": "softlink", + "sha256": "acf953233d267bba2f7fa051bf3a1d39ca04c766735556a941283c4029c045ae", + "size_in_bytes": 1178824 + }, + { + "_path": "lib/libiconv.so.2.7.0", + "path_type": "hardlink", + "sha256": "acf953233d267bba2f7fa051bf3a1d39ca04c766735556a941283c4029c045ae", + "size_in_bytes": 1178824 + }, + { + "_path": "share/locale/af/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "7c65895b6fc629a7a30ae605947cbe1a704d2efe1c57e822409c8d946dd5673c", + "size_in_bytes": 729 + }, + { + "_path": "share/locale/be/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "8671869ee23327237330cba8b88996e03dddc4da4eb00112d5b1710a0939c618", + "size_in_bytes": 9259 + }, + { + "_path": "share/locale/bg/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "3165e7408489c7449e3daf6423ffdce55c88cffbf2f17e5b49a7aea98bbbcf64", + "size_in_bytes": 9074 + }, + { + "_path": "share/locale/ca/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "f5dda5ff165aeacc90668235607c4a613dd1222bbe196b5f3516904e40010e31", + "size_in_bytes": 756 + }, + { + "_path": "share/locale/cs/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "e0feece2052c7394b02c795f4ed241d082d64bf7d63df55b301bdb4ff178763f", + "size_in_bytes": 7245 + }, + { + "_path": "share/locale/da/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "db8e16e2538adb4e90ea3cfde42d5c5010c83c6302cb5faad51d2947b3d85392", + "size_in_bytes": 6235 + }, + { + "_path": "share/locale/de/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "2a2ec0523db7b73db698a47adcc556e55447cad52b9d01a7e518eda66b9ef29b", + "size_in_bytes": 7467 + }, + { + "_path": "share/locale/el/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "c4a8666611c6e0dd5eed56e6daf0243e78fa2b28c724d0ce7d4d173ae11f1ba0", + "size_in_bytes": 775 + }, + { + "_path": "share/locale/eo/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "f00a73f69d7289331629c038addef0259350c085fddef69a5a098e928374df2f", + "size_in_bytes": 6707 + }, + { + "_path": "share/locale/es/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "e976ac955f520e8a1ea6a309c54ef6a7ff63999eb35da56494dc17d66a39a15d", + "size_in_bytes": 6372 + }, + { + "_path": "share/locale/et/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "2ec7ef38eb4de6ecaeaaee0339e2ba10545db5d062006297a3d557196188face", + "size_in_bytes": 6118 + }, + { + "_path": "share/locale/fi/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "7c8e77b0e3ad914a3b8a4d2dce4a96d0899a1902500f078f88a83e5532a87e7e", + "size_in_bytes": 6214 + }, + { + "_path": "share/locale/fr/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "4215e81c73750d9bdb0febb181923e74c7a38b6a388c938af5a52f7945055732", + "size_in_bytes": 7050 + }, + { + "_path": "share/locale/ga/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "9b040428fe3166b72c2a8189d3a476912a6c9f618760c3f3a3395f0759a65ca0", + "size_in_bytes": 6793 + }, + { + "_path": "share/locale/gl/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "c23c85f0207641bbb649e4c6ec582b7359759465aca70fd0c07fae12184d917d", + "size_in_bytes": 6462 + }, + { + "_path": "share/locale/hr/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "703ba2ce42fc1620e9cd8b3074caad906eab9ce56f7300f8635287e8f15cc522", + "size_in_bytes": 6232 + }, + { + "_path": "share/locale/hu/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "1da3b432b1cf9ece27b2a6d678349611e5aa0e755fd0b40d0a4c7933bae24c1f", + "size_in_bytes": 6731 + }, + { + "_path": "share/locale/id/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "c486ed0b1e87790c8ca339d3c8cc75b6419e4c3dbbc89d635c307c4b961791a5", + "size_in_bytes": 6841 + }, + { + "_path": "share/locale/it/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "abbffc31a677252e7e209c5361ae63cea6ccbab712eb97fc30a00b8c1ee17315", + "size_in_bytes": 7010 + }, + { + "_path": "share/locale/ja/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "7f6cf72f01eb1063af3d32de3bc7db2ce2039dd0bb909bc50124fe79b086449d", + "size_in_bytes": 6746 + }, + { + "_path": "share/locale/ka/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "df3ef6e71465322f7aefff716b03d50536aeaa15c6beb4e8ad35910086d2a174", + "size_in_bytes": 9620 + }, + { + "_path": "share/locale/ko/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "9c39073cbbe767c5e551fd664bbb85529cc3df9112dec1328fabec803dcf9c47", + "size_in_bytes": 7108 + }, + { + "_path": "share/locale/lt/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "e87a5a67cf31a92e7d1d2554a6258bdb500493439926cfeb02f3bf6d12e4e610", + "size_in_bytes": 7242 + }, + { + "_path": "share/locale/nl/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "d6e4c2528de5c872b33af838318b5d2f67e72889cce8912579d34a78036ba3f2", + "size_in_bytes": 6918 + }, + { + "_path": "share/locale/pl/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "5343a7fb679b57245ac140febb67933d29ba4885822a5cfb0d6d1c660f096073", + "size_in_bytes": 7174 + }, + { + "_path": "share/locale/pt_BR/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "847547c1ebd315ce010fce018b0d463b082fddbde11f0fa34eff75efbf352fee", + "size_in_bytes": 7172 + }, + { + "_path": "share/locale/rm/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "b312e7917da6ba4189f4407229d48e71e882ca4dfbb754379ab95de8f2164886", + "size_in_bytes": 750 + }, + { + "_path": "share/locale/ro/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "49aaa5fb7f89a17629aacc9911d998195ade20dd5deb69660d5e1681ac30eb44", + "size_in_bytes": 7529 + }, + { + "_path": "share/locale/ru/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "a89832b57947b3ddf93113914de004dcd89fcb90412a37fa5818eabefb044dc5", + "size_in_bytes": 9082 + }, + { + "_path": "share/locale/sk/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "c6e5a2a4ac296fa2fafd3327214bd98c7f31641e50d5787840a79d2680e4cd4e", + "size_in_bytes": 7262 + }, + { + "_path": "share/locale/sl/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "589a3fed97599d5e740ea8f857e72f99592b2068a58cc5d1fc49b87f92e09ef9", + "size_in_bytes": 6267 + }, + { + "_path": "share/locale/sq/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "2f1765206d3b77bf09abaa3b1fddb1b144216863e62057bb870ba47106c24ebc", + "size_in_bytes": 757 + }, + { + "_path": "share/locale/sr/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "646560ac9aa2db899deb7e7ef6be736f2ea879ba9bdaaa3f515c77185be6713c", + "size_in_bytes": 8417 + }, + { + "_path": "share/locale/sv/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "829e89a1ae041159e2315e21b7dc6ee4b64eacc54bfde7011a53d5f8f3be66c3", + "size_in_bytes": 6918 + }, + { + "_path": "share/locale/tr/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "8c8b4125d658b29ce31a9248bef95f2d12f7484fddb5d3ab927bc89cfb24578c", + "size_in_bytes": 750 + }, + { + "_path": "share/locale/uk/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "78b1eda8e94fd02d3592de930c31e04c804e5c333a3771f99d6fbfd65ee83f7a", + "size_in_bytes": 9664 + }, + { + "_path": "share/locale/vi/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "5b5327ba3620c3b657b7cdb7c8b03cc629877a3962cbfb929f0663856bcb71e7", + "size_in_bytes": 7473 + }, + { + "_path": "share/locale/wa/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "e5196d6ed13bac907f6809127f16357648fc770d08b09b1d0361291ec493560d", + "size_in_bytes": 6848 + }, + { + "_path": "share/locale/zh_CN/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "0aa9781dd830769d42050546f2729bd266d1ee533b8419d1836e8c98dedb3499", + "size_in_bytes": 6504 + }, + { + "_path": "share/locale/zh_TW/LC_MESSAGES/libiconv.mo", + "path_type": "hardlink", + "sha256": "6b8d38878e8254309f226a7dc0d0015b9a13bc35dfe1ab7885967ee660ece3a6", + "size_in_bytes": 6439 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..024f2a9bd6eef92f80c3fe06b859d719d4637e3b --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,32 @@ +c_compiler: gcc +c_compiler_version: 14.3.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +extend_keys: +- ignore_build_only_deps +- ignore_version +- extend_keys +- pin_run_as_build +fortran_compiler: gfortran +ignore_build_only_deps: +- numpy +- python +libiconv: '1' +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.10' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/install.sh b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..92cb11adc7df9efb9cb9d0d7d849d0ec82397ce1 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/install.sh @@ -0,0 +1,25 @@ +make install + +# TODO :: Only provide a static iconv executable for GNU/Linux. +# TODO :: glibc has iconv built-in. I am only providing it here +# TODO :: for legacy packages (and through gritted teeth). +if [[ ${HOST} =~ .*linux.* ]]; then + chmod 755 ${PREFIX}/lib/libiconv.so.2.7.0 + chmod 755 ${PREFIX}/lib/libcharset.so.1.0.0 + if [ -f ${PREFIX}/lib/preloadable_libiconv.so ]; then + chmod 755 ${PREFIX}/lib/preloadable_libiconv.so + fi +fi + +# remove libtool files +find $PREFIX -name '*.la' -delete + +if [[ "${PKG_NAME}" == "libiconv" ]]; then + # remove iconv executable + rm $PREFIX/bin/iconv + rm -rf $PREFIX/share/man + rm -rf $PREFIX/share/doc +else + # relying on conda-build to deduplicate files + echo "Keeping all files, conda-build will deduplicate files" +fi diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/meta.yaml b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f8fba476fad7e6537b1fb1a99c14a9f295c72637 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/meta.yaml @@ -0,0 +1,79 @@ +# This file created by conda-build 26.1.0 +# ------------------------------------------------ + +package: + name: libiconv + version: '1.18' +source: + - url: https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.18.tar.gz + sha256: 3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8 + patches: + - patches/glibc.patch +build: + run_exports: + - libiconv >=1.18,<2.0a0 + number: 0 + string: h75a1612_0 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - binutils_impl_linux-64 2.44 h4b9a079_2 + - binutils_linux-64 2.44 hc03a8fd_2 + - gcc_impl_linux-64 14.3.0 h4943218_4 + - gcc_linux-64 14.3.0 hda73cce_12 + - kernel-headers_linux-64 4.18.0 h3108a97_1 + - ld_impl_linux-64 2.44 h153f514_2 + - libgcc 15.2.0 h69a1729_7 + - libgcc-devel_linux-64 14.3.0 he7458c1_104 + - libgcc-ng 15.2.0 h166f726_7 + - libgomp 15.2.0 h4751f2c_7 + - libltdl 2.6.0 h47b2149_0 + - libsanitizer 14.3.0 hd4faa28_4 + - libstdcxx 15.2.0 h39759b7_7 + - libtool 2.6.0 h7354ed3_0 + - make 4.2.1 h1bed415_1 + - sysroot_linux-64 2.28 h3108a97_1 + - tzdata 2025c he532380_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - libgcc 15.2.0 h69a1729_7 + - libgomp 15.2.0 h4751f2c_7 + run: + - __glibc >=2.28,<3.0.a0 + - libgcc >=14 +test: + requires: + - jq + commands: + - iconv -l + - test ! -f ${PREFIX}/bin/iconv + - test_man_files=$(jq '.files[] | select( . | startswith("share/man"))' $CONDA_PREFIX/conda-meta/libiconv-1.18-${PKG_BUILD_STRING}.json) + - if [[ ${test_man_files} ]]; then echo "found GPL licensed files being packaged + ${test_man_files}"; exit 1; fi + - test_doc_files=$(jq '.files[] | select( . | startswith("share/doc"))' $CONDA_PREFIX/conda-meta/libiconv-1.18-${PKG_BUILD_STRING}.json) + - if [[ ${test_doc_files} ]]; then echo "found GPL licensed files being packaged + ${test_doc_files}"; exit 1; fi + - test -f $PREFIX/lib/libiconv${SHLIB_EXT} + - test -f $PREFIX/lib/libcharset${SHLIB_EXT} +about: + home: https://www.gnu.org/software/libiconv + license: LGPL-2.1-only + license_file: COPYING.LIB + summary: Provides iconv for systems which don't have one (or that cannot convert + from/to Unicode.) +extra: + recipe-maintainers: + - jakirkham + - jhamman + - mingwandroid + - ocefpaf + - scopatz + final: true + copy_test_source_files: true + remote_url: https://github.com/AnacondaRecipes/libiconv-feedstock + sha: a42f10c26cf243d7b6722426f4d1965fd7ad84e6 + task_id: U0FZCtlBTSK4RiGua7nFww + task_run_id: '0' + pbp_graph_uuid: a645ec97-1204-48b8-b3a2-b8f08653019a diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/bld.bat b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..0c10dac852ea9a9995a0524640717596aa83e4fc --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/bld.bat @@ -0,0 +1,14 @@ +mkdir build +pushd build + +cmake %CMAKE_ARGS% -GNinja -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -D CMAKE_BUILD_TYPE=Release .. +if errorlevel 1 exit 1 + +ninja +if errorlevel 1 exit 1 + +:: Test. +if not "%CONDA_BUILD_SKIP_TESTS%"=="1" ( + ctest -C Release +) +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/build.sh b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..5ce0b29b1428ec22bcb488bb6add573d24aeb8aa --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +set -euxo pipefail + +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/libtool/build-aux/config.* ./build-aux +cp $BUILD_PREFIX/share/libtool/build-aux/config.* ./libcharset/build-aux + +./configure --prefix=${PREFIX} \ + --host=${HOST} \ + --build=${BUILD} \ + --enable-static \ + --disable-rpath \ + --enable-extra-encodings + +if [[ "${target_platform}" == osx-* ]]; then + make -f Makefile.devel CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS}" +fi + +make -j${CPU_COUNT} diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/conda_build_config.yaml b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c77271071032d0e212505367f6e288fbd25bb1fb --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,2 @@ +c_compiler: + - clang_bootstrap # [osx] diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.bat b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.bat new file mode 100644 index 0000000000000000000000000000000000000000..4fc347c0ebbdb515dcb6cdc1b3db49304c48e6b3 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.bat @@ -0,0 +1,12 @@ +pushd build + +:: Install. +ninja install +if errorlevel 1 exit 1 + +if %PKG_NAME%==libiconv ( + if exist %LIBRARY_PREFIX%\bin\iconv.exe DEL %LIBRARY_PREFIX%\bin\iconv.exe +) else ( + :: relying on conda-build to deduplicate files + echo "Keeping all files, conda-build will deduplicate files" +) \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.sh b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..92cb11adc7df9efb9cb9d0d7d849d0ec82397ce1 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/install.sh @@ -0,0 +1,25 @@ +make install + +# TODO :: Only provide a static iconv executable for GNU/Linux. +# TODO :: glibc has iconv built-in. I am only providing it here +# TODO :: for legacy packages (and through gritted teeth). +if [[ ${HOST} =~ .*linux.* ]]; then + chmod 755 ${PREFIX}/lib/libiconv.so.2.7.0 + chmod 755 ${PREFIX}/lib/libcharset.so.1.0.0 + if [ -f ${PREFIX}/lib/preloadable_libiconv.so ]; then + chmod 755 ${PREFIX}/lib/preloadable_libiconv.so + fi +fi + +# remove libtool files +find $PREFIX -name '*.la' -delete + +if [[ "${PKG_NAME}" == "libiconv" ]]; then + # remove iconv executable + rm $PREFIX/bin/iconv + rm -rf $PREFIX/share/man + rm -rf $PREFIX/share/doc +else + # relying on conda-build to deduplicate files + echo "Keeping all files, conda-build will deduplicate files" +fi diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e401288a54933a7a109e6f0a5581073c19590e83 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/meta.yaml @@ -0,0 +1,107 @@ +{% set name = "libiconv" %} +{% set version = "1.18" %} + +package: + name: libiconv-split + version: {{ version }} + +source: + - url: https://ftp.gnu.org/pub/gnu/{{ name }}/{{ name }}-{{ version }}.tar.gz + sha256: 3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8 + patches: + - patches/glibc.patch # [linux] + - patches/CMakeLists.txt.patch # [win] + - patches/config.h.patch # [win] + - patches/configure.cmake.patch # [win] + - patches/utf_8_mac.patch # [osx] + - patches/fix-aclocal-exact-tool-pin.patch # [osx] + +build: + number: 0 + +requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - automake # [osx] + - autoconf # [osx] + - groff # [osx] + - gperf # [osx] + - libtool # [unix] + - cmake <4 # [win] + - ninja-base # [win] + - make # [unix] + +outputs: + - name: libiconv + script: install.sh # [unix] + script: install.bat # [win] + build: + run_exports: + # Pretty good recently, let's trust them. + # https://abi-laboratory.pro/tracker/timeline/libiconv + - {{ pin_subpackage('libiconv') }} + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - cmake <4 # [win] + - ninja-base # [win] + - libtool # [unix] + - make # [unix] + + test: + requires: + - jq # [unix] + - pkg-config # [win] + commands: + - iconv -l # [unix] + # Ensuring iconv executable is not present. + # Otherwise the included license is wrong and should be GPL-3.0-only. + - test ! -f ${PREFIX}/bin/iconv # [unix] + - if exist %LIBRARY_PREFIX%\bin\iconv.exe exit 1 # [win] + # Ensuring libiconv documentation and man pages is not present. + # Otherwise inlcuded license is wrong and should be GPL-3.0-only. + - test_man_files=$(jq '.files[] | select( . | startswith("share/man"))' $CONDA_PREFIX/conda-meta/{{ PKG_NAME }}-{{ PKG_VERSION }}-${PKG_BUILD_STRING}.json) # [unix] + - if [[ ${test_man_files} ]]; then echo "found GPL licensed files being packaged ${test_man_files}"; exit 1; fi # [unix] + - test_doc_files=$(jq '.files[] | select( . | startswith("share/doc"))' $CONDA_PREFIX/conda-meta/{{ PKG_NAME }}-{{ PKG_VERSION }}-${PKG_BUILD_STRING}.json) # [unix] + - if [[ ${test_doc_files} ]]; then echo "found GPL licensed files being packaged ${test_doc_files}"; exit 1; fi # [unix] + - if exist "%LIBRARY_PREFIX%\share\man\man3\iconv*" exit 1 # [win] + - if exist "%LIBRARY_PREFIX%\share\doc\iconv*" exit 1 # [win] + # Assert libraries are present + - test -f $PREFIX/lib/libiconv${SHLIB_EXT} # [unix] + - test -f $PREFIX/lib/libcharset${SHLIB_EXT} # [unix] + - if not exist %LIBRARY_PREFIX%\lib\iconv.lib exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\lib\charset.lib exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\bin\iconv.dll exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\bin\charset.dll exit 1 # [win] + # Regression test for https://github.com/conda-forge/libiconv-feedstock/issues/48 + - pkg-config --help # [win] + + about: + home: https://www.gnu.org/software/libiconv + license: LGPL-2.1-only + license_file: COPYING.LIB + summary: Provides iconv for systems which don't have one (or that cannot convert from/to Unicode.) + +about: + home: https://www.gnu.org/software/libiconv + license: GPL-3.0-or-later + license_file: + - COPYING + - COPYING.LIB + license_family: GPL3 + summary: "Provides iconv for systems which don't have one (or that cannot convert from/to Unicode.)" + description: | + This library provides an iconv() implementation, for use on systems which don't have one, + or whose implementation cannot convert from/to Unicode. + doc_url: https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.18/iconv.1.html + dev_url: https://git.savannah.gnu.org/cgit/libiconv.git/tree + +extra: + recipe-maintainers: + - ocefpaf + - jakirkham + - jhamman + - mingwandroid + - scopatz diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/CMakeLists.txt.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/CMakeLists.txt.patch new file mode 100644 index 0000000000000000000000000000000000000000..cdbf33bca9b2e4015cfdc193fc6635cb48dbeffc --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/CMakeLists.txt.patch @@ -0,0 +1,69 @@ +--- /dev/null ++++ CMakeLists.txt +@@ -0,0 +1,66 @@ ++# Copyright (C) 2007-2012 LuaDist. ++# Created by Peter Drahoš ++# Redistribution and use of this file is allowed according to the terms of the MIT license. ++# For details see the COPYRIGHT file distributed with LuaDist. ++# Please note that the package source code is licensed under its own license. ++ ++project(libiconv C) ++cmake_minimum_required(VERSION 3.4) ++include(configure.cmake) ++ ++# Options ++option(ENABLE_EXTRA "Enable a few rarely used encodings" OFF) ++option(ENABLE_NLS "Translation of program messages to the user's native language is requested" OFF) ++ ++# iconv.h ++set(USE_MBSTATE_T 1) ++set(BROKEN_WCHAR_H 0) ++set(HAVE_WCHAR_T 0) ++ ++configure_file(config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h) ++configure_file(include/iconv.h.build.in ${CMAKE_CURRENT_SOURCE_DIR}/include/iconv.h) ++configure_file(libcharset/include/libcharset.h.build.in ${CMAKE_CURRENT_SOURCE_DIR}/include/libcharset.h) ++configure_file(srclib/uniwidth.in.h ${CMAKE_CURRENT_SOURCE_DIR}/srclib/uniwidth.h) ++configure_file(srclib/unitypes.in.h ${CMAKE_CURRENT_SOURCE_DIR}/srclib/unitypes.h) ++ ++# Dirty fix for MinGW ++if (MINGW) ++ add_definitions(-DELOOP=0 -DHAVE_DECL_STRERROR_R=0) ++ configure_file(srclib/alloca.in.h ${CMAKE_CURRENT_SOURCE_DIR}/srclib/alloca.h) ++endif () ++ ++include_directories(${CMAKE_CURRENT_SOURCE_DIR} include srclib) ++add_definitions(-DHAVE_CONFIG_H) ++ ++# libcharset ++set(SRC_LIBCHARSET ++ libcharset/lib/localcharset.c ++ libcharset/lib/relocatable-stub.c ++) ++ ++add_library(charset SHARED ${SRC_LIBCHARSET}) ++set_target_properties(charset PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++target_compile_definitions(charset PRIVATE BUILDING_LIBCHARSET) ++ ++# libiconv ++set(SRC_LIBICONV ++ lib/iconv.c ++ lib/compat.c ++) ++ ++add_library(iconv SHARED ${SRC_LIBICONV}) ++target_link_libraries(iconv charset) ++set_target_properties(iconv PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++target_compile_definitions(iconv PRIVATE BUILDING_LIBICONV ENABLE_EXTRA=1) ++ ++# removed exe since it requires safe_read which doesn't work with MSVC ++#add_executable(iconvcli src/iconv_no_i18n.c) ++#target_link_libraries(iconvcli iconv icrt charset) ++#set_target_properties(iconvcli PROPERTIES RUNTIME_OUTPUT_NAME iconv) ++ ++install(TARGETS iconv charset #iconvcli ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ ++install(FILES include/iconv.h include/libcharset.h srclib/localcharset.h DESTINATION include) diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/config.h.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/config.h.patch new file mode 100644 index 0000000000000000000000000000000000000000..8f011b7a85270be3a872de5be1bebedf320a42ef --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/config.h.patch @@ -0,0 +1,929 @@ +--- config.h.cmake 1970-01-01 10:00:00.000000000 +1000 ++++ config.h.cmake 2016-06-07 16:05:50.311507800 +1000 +@@ -0,0 +1,926 @@ ++/* config.h.in. Generated from configure.ac by autoheader. */ ++ ++/* Define to the number of bits in type 'ptrdiff_t'. */ ++#cmakedefine BITSIZEOF_PTRDIFF_T @BITSIZEOF_PTRDIFF_T@ ++ ++/* Define to the number of bits in type 'sig_atomic_t'. */ ++#cmakedefine BITSIZEOF_SIG_ATOMIC_T @BITSIZEOF_SIG_ATOMIC_T@ ++ ++/* Define to the number of bits in type 'size_t'. */ ++#cmakedefine BITSIZEOF_SIZE_T @BITSIZEOF_SIZE_T@ ++ ++/* Define to the number of bits in type 'wchar_t'. */ ++#cmakedefine BITSIZEOF_WCHAR_T @BITSIZEOF_WCHAR_T@ ++ ++/* Define to the number of bits in type 'wint_t'. */ ++#cmakedefine BITSIZEOF_WINT_T @BITSIZEOF_WINT_T@ ++ ++/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP ++ systems. This function is required for `alloca.c' support on those systems. ++ */ ++#cmakedefine CRAY_STACKSEG_END @CRAY_STACKSEG_END@ ++ ++/* Define to 1 if using `alloca.c'. */ ++#cmakedefine C_ALLOCA 1 ++ ++/* Define to 1 if // is a file system root distinct from /. */ ++#cmakedefine DOUBLE_SLASH_IS_DISTINCT_ROOT 1 ++ ++/* Define as good substitute value for EILSEQ. */ ++#cmakedefine EILSEQ @ELISEQ@ ++ ++/* Define to 1 to enable a few rarely used encodings. */ ++#cmakedefine ENABLE_EXTRA 1 ++ ++/* Define to 1 if translation of program messages to the user's native ++ language is requested. */ ++#cmakedefine ENABLE_NLS 1 ++ ++/* Define to 1 if the package shall run at any location in the file system. */ ++#cmakedefine ENABLE_RELOCATABLE 1 ++ ++/* Define to 1 if realpath() can malloc memory, always gives an absolute path, ++ and handles trailing slash correctly. */ ++#cmakedefine FUNC_REALPATH_WORKS 1 ++ ++/* Define to a C preprocessor expression that evaluates to 1 or 0, depending ++ whether the gnulib module canonicalize-lgpl shall be considered present. */ ++#cmakedefine GNULIB_CANONICALIZE_LGPL 1 ++ ++/* Define to a C preprocessor expression that evaluates to 1 or 0, depending ++ whether the gnulib module sigpipe shall be considered present. */ ++#cmakedefine GNULIB_SIGPIPE 1 ++ ++/* Define to a C preprocessor expression that evaluates to 1 or 0, depending ++ whether the gnulib module strerror shall be considered present. */ ++#cmakedefine GNULIB_STRERROR 1 ++ ++/* Define to 1 when the gnulib module canonicalize_file_name should be tested. ++ */ ++#cmakedefine GNULIB_TEST_CANONICALIZE_FILE_NAME @GNULIB_TEST_CANONICALIZE_FILE_NAME@ ++ ++/* Define to 1 when the gnulib module environ should be tested. */ ++#cmakedefine GNULIB_TEST_ENVIRON 1 ++ ++/* Define to 1 when the gnulib module lstat should be tested. */ ++#cmakedefine GNULIB_TEST_LSTAT 1 ++ ++/* Define to 1 when the gnulib module read should be tested. */ ++#cmakedefine GNULIB_TEST_READ 1 ++ ++/* Define to 1 when the gnulib module readlink should be tested. */ ++#cmakedefine GNULIB_TEST_READLINK 1 ++ ++/* Define to 1 when the gnulib module realpath should be tested. */ ++#cmakedefine GNULIB_TEST_REALPATH 1 ++ ++/* Define to 1 when the gnulib module sigprocmask should be tested. */ ++#cmakedefine GNULIB_TEST_SIGPROCMASK 1 ++ ++/* Define to 1 when the gnulib module stat should be tested. */ ++#cmakedefine GNULIB_TEST_STAT 1 ++ ++/* Define to 1 when the gnulib module strerror should be tested. */ ++#cmakedefine GNULIB_TEST_STRERROR 1 ++ ++/* Define to 1 if you have `alloca', as a function or macro. */ ++#cmakedefine HAVE_ALLOCA 1 ++ ++/* Define to 1 if you have and it should be used (not on Ultrix). ++ */ ++#cmakedefine HAVE_ALLOCA_H 1 ++ ++/* Define to 1 if you have the `canonicalize_file_name' function. */ ++#cmakedefine HAVE_CANONICALIZE_FILE_NAME 1 ++ ++/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the ++ CoreFoundation framework. */ ++#cmakedefine HAVE_CFLOCALECOPYCURRENT 1 ++ ++/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in ++ the CoreFoundation framework. */ ++#cmakedefine HAVE_CFPREFERENCESCOPYAPPVALUE 1 ++ ++/* Define if the GNU dcgettext() function is already present or preinstalled. ++ */ ++#cmakedefine HAVE_DCGETTEXT 1 ++ ++/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_CLEARERR_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you ++ don't. */ ++#cmakedefine HAVE_DECL_FEOF_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FERROR_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FFLUSH_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FGETS_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FPUTC_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FPUTS_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FREAD_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_FWRITE_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_GETCHAR_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you ++ don't. */ ++#cmakedefine HAVE_DECL_GETC_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `program_invocation_name', and ++ to 0 if you don't. */ ++#cmakedefine HAVE_DECL_PROGRAM_INVOCATION_NAME 1 ++ ++/* Define to 1 if you have the declaration of `program_invocation_short_name', ++ and to 0 if you don't. */ ++#cmakedefine HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 ++ ++/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if ++ you don't. */ ++#cmakedefine HAVE_DECL_PUTCHAR_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you ++ don't. */ ++#cmakedefine HAVE_DECL_PUTC_UNLOCKED 1 ++ ++/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't. ++ */ ++#cmakedefine HAVE_DECL_SETENV 1 ++ ++/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you ++ don't. */ ++#cmakedefine HAVE_DECL_STRERROR_R 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_DLFCN_H 1 ++ ++/* Define if you have the declaration of environ. */ ++#cmakedefine HAVE_ENVIRON_DECL 1 ++ ++/* Define to 1 if you have the `getcwd' function. */ ++#cmakedefine HAVE_GETCWD 1 ++ ++/* Define to 1 if you have the `getc_unlocked' function. */ ++#cmakedefine HAVE_GETC_UNLOCKED 1 ++ ++/* Define if the GNU gettext() function is already present or preinstalled. */ ++#cmakedefine HAVE_GETTEXT 1 ++ ++/* Define if you have the iconv() function and it works. */ ++#cmakedefine HAVE_ICONV 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_INTTYPES_H 1 ++ ++/* Define if you have and nl_langinfo(CODESET). */ ++#cmakedefine HAVE_LANGINFO_CODESET 1 ++ ++/* Define to 1 if the system has the type `long long int'. */ ++#cmakedefine HAVE_LONG_LONG_INT 1 ++ ++/* Define to 1 if you have the `lstat' function. */ ++#cmakedefine HAVE_LSTAT 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_MACH_O_DYLD_H 1 ++ ++/* Define to 1 if you have the `mbrtowc' function. */ ++#cmakedefine HAVE_MBRTOWC 1 ++ ++/* Define to 1 if you have the `mbsinit' function. */ ++#cmakedefine HAVE_MBSINIT 1 ++ ++/* Define to 1 if declares mbstate_t. */ ++#cmakedefine HAVE_MBSTATE_T 1 ++ ++/* Define to 1 if you have the `memmove' function. */ ++#cmakedefine HAVE_MEMMOVE 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_MEMORY_H 1 ++ ++/* Define to 1 if atoll is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_ATOLL 1 ++ ++/* Define to 1 if canonicalize_file_name is declared even after undefining ++ macros. */ ++#cmakedefine HAVE_RAW_DECL_CANONICALIZE_FILE_NAME 1 ++ ++/* Define to 1 if chown is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_CHOWN 1 ++ ++/* Define to 1 if dprintf is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_DPRINTF 1 ++ ++/* Define to 1 if dup2 is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_DUP2 1 ++ ++/* Define to 1 if dup3 is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_DUP3 1 ++ ++/* Define to 1 if endusershell is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_ENDUSERSHELL 1 ++ ++/* Define to 1 if environ is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_ENVIRON 1 ++ ++/* Define to 1 if euidaccess is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_EUIDACCESS 1 ++ ++/* Define to 1 if faccessat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FACCESSAT 1 ++ ++/* Define to 1 if fchdir is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FCHDIR 1 ++ ++/* Define to 1 if fchmodat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FCHMODAT 1 ++ ++/* Define to 1 if fchownat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FCHOWNAT 1 ++ ++/* Define to 1 if fcntl is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FCNTL 1 ++ ++/* Define to 1 if ffsl is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FFSL 1 ++ ++/* Define to 1 if ffsll is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FFSLL 1 ++ ++/* Define to 1 if fpurge is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FPURGE 1 ++ ++/* Define to 1 if fseeko is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FSEEKO 1 ++ ++/* Define to 1 if fstatat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FSTATAT 1 ++ ++/* Define to 1 if fsync is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FSYNC 1 ++ ++/* Define to 1 if ftello is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FTELLO 1 ++ ++/* Define to 1 if ftruncate is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FTRUNCATE 1 ++ ++/* Define to 1 if futimens is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_FUTIMENS 1 ++ ++/* Define to 1 if getcwd is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETCWD 1 ++ ++/* Define to 1 if getdelim is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETDELIM 1 ++ ++/* Define to 1 if getdomainname is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETDOMAINNAME 1 ++ ++/* Define to 1 if getdtablesize is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETDTABLESIZE 1 ++ ++/* Define to 1 if getgroups is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETGROUPS 1 ++ ++/* Define to 1 if gethostname is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETHOSTNAME 1 ++ ++/* Define to 1 if getline is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETLINE 1 ++ ++/* Define to 1 if getloadavg is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETLOADAVG 1 ++ ++/* Define to 1 if getlogin is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETLOGIN 1 ++ ++/* Define to 1 if getlogin_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETLOGIN_R 1 ++ ++/* Define to 1 if getpagesize is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETPAGESIZE 1 ++ ++/* Define to 1 if getsubopt is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETSUBOPT 1 ++ ++/* Define to 1 if getusershell is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GETUSERSHELL 1 ++ ++/* Define to 1 if grantpt is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GRANTPT 1 ++ ++/* Define to 1 if group_member is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_GROUP_MEMBER 1 ++ ++/* Define to 1 if initstat_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_INITSTAT_R 1 ++ ++/* Define to 1 if lchmod is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LCHMOD 1 ++ ++/* Define to 1 if lchown is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LCHOWN 1 ++ ++/* Define to 1 if link is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LINK 1 ++ ++/* Define to 1 if linkat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LINKAT 1 ++ ++/* Define to 1 if lseek is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LSEEK 1 ++ ++/* Define to 1 if lstat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_LSTAT 1 ++ ++/* Define to 1 if memmem is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MEMMEM 1 ++ ++/* Define to 1 if mempcpy is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MEMPCPY 1 ++ ++/* Define to 1 if memrchr is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MEMRCHR 1 ++ ++/* Define to 1 if mkdirat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKDIRAT 1 ++ ++/* Define to 1 if mkdtemp is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKDTEMP 1 ++ ++/* Define to 1 if mkfifo is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKFIFO 1 ++ ++/* Define to 1 if mkfifoat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKFIFOAT 1 ++ ++/* Define to 1 if mknod is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKNOD 1 ++ ++/* Define to 1 if mknodat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKNODAT 1 ++ ++/* Define to 1 if mkostemp is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKOSTEMP 1 ++ ++/* Define to 1 if mkostemps is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKOSTEMPS 1 ++ ++/* Define to 1 if mkstemp is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKSTEMP 1 ++ ++/* Define to 1 if mkstemps is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_MKSTEMPS 1 ++ ++/* Define to 1 if openat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_OPENAT 1 ++ ++/* Define to 1 if pipe is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PIPE 1 ++ ++/* Define to 1 if pipe2 is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PIPE2 1 ++ ++/* Define to 1 if popen is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_POPEN 1 ++ ++/* Define to 1 if pread is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PREAD 1 ++ ++/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PTHREAD_SIGMASK 1 ++ ++/* Define to 1 if ptsname is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PTSNAME 1 ++ ++/* Define to 1 if pwrite is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_PWRITE 1 ++ ++/* Define to 1 if random_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_RANDOM_R 1 ++ ++/* Define to 1 if rawmemchr is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_RAWMEMCHR 1 ++ ++/* Define to 1 if readlink is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_READLINK 1 ++ ++/* Define to 1 if readlinkat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_READLINKAT 1 ++ ++/* Define to 1 if realpath is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_REALPATH 1 ++ ++/* Define to 1 if renameat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_RENAMEAT 1 ++ ++/* Define to 1 if rmdir is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_RMDIR 1 ++ ++/* Define to 1 if rpmatch is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_RPMATCH 1 ++ ++/* Define to 1 if setenv is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SETENV 1 ++ ++/* Define to 1 if setstate_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SETSTATE_R 1 ++ ++/* Define to 1 if setusershell is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SETUSERSHELL 1 ++ ++/* Define to 1 if sigaction is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGACTION 1 ++ ++/* Define to 1 if sigaddset is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGADDSET 1 ++ ++/* Define to 1 if sigdelset is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGDELSET 1 ++ ++/* Define to 1 if sigemptyset is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGEMPTYSET 1 ++ ++/* Define to 1 if sigfillset is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGFILLSET 1 ++ ++/* Define to 1 if sigismember is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGISMEMBER 1 ++ ++/* Define to 1 if sigpending is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGPENDING 1 ++ ++/* Define to 1 if sigprocmask is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SIGPROCMASK 1 ++ ++/* Define to 1 if sleep is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SLEEP 1 ++ ++/* Define to 1 if snprintf is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SNPRINTF 1 ++ ++/* Define to 1 if srandom_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SRANDOM_R 1 ++ ++/* Define to 1 if stat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STAT 1 ++ ++/* Define to 1 if stpcpy is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STPCPY 1 ++ ++/* Define to 1 if stpncpy is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STPNCPY 1 ++ ++/* Define to 1 if strcasestr is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRCASESTR 1 ++ ++/* Define to 1 if strchrnul is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRCHRNUL 1 ++ ++/* Define to 1 if strdup is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRDUP 1 ++ ++/* Define to 1 if strerror_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRERROR_R 1 ++ ++/* Define to 1 if strncat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRNCAT 1 ++ ++/* Define to 1 if strndup is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRNDUP 1 ++ ++/* Define to 1 if strnlen is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRNLEN 1 ++ ++/* Define to 1 if strpbrk is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRPBRK 1 ++ ++/* Define to 1 if strsep is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRSEP 1 ++ ++/* Define to 1 if strsignal is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRSIGNAL 1 ++ ++/* Define to 1 if strtod is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRTOD 1 ++ ++/* Define to 1 if strtok_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRTOK_R 1 ++ ++/* Define to 1 if strtoll is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRTOLL 1 ++ ++/* Define to 1 if strtoull is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRTOULL 1 ++ ++/* Define to 1 if strverscmp is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_STRVERSCMP 1 ++ ++/* Define to 1 if symlink is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SYMLINK 1 ++ ++/* Define to 1 if symlinkat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_SYMLINKAT 1 ++ ++/* Define to 1 if tmpfile is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_TMPFILE 1 ++ ++/* Define to 1 if ttyname_r is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_TTYNAME_R 1 ++ ++/* Define to 1 if unlink is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_UNLINK 1 ++ ++/* Define to 1 if unlinkat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_UNLINKAT 1 ++ ++/* Define to 1 if unlockpt is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_UNLOCKPT 1 ++ ++/* Define to 1 if unsetenv is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_UNSETENV 1 ++ ++/* Define to 1 if usleep is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_USLEEP 1 ++ ++/* Define to 1 if utimensat is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_UTIMENSAT 1 ++ ++/* Define to 1 if vdprintf is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_VDPRINTF 1 ++ ++/* Define to 1 if vsnprintf is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL_VSNPRINTF 1 ++ ++/* Define to 1 if _Exit is declared even after undefining macros. */ ++#cmakedefine HAVE_RAW_DECL__EXIT 1 ++ ++/* Define to 1 if you have the `readlink' function. */ ++#cmakedefine HAVE_READLINK 1 ++ ++/* Define to 1 if you have the `readlinkat' function. */ ++#cmakedefine HAVE_READLINKAT 1 ++ ++/* Define to 1 if you have the `realpath' function. */ ++#cmakedefine HAVE_REALPATH 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SEARCH_H 1 ++ ++/* Define to 1 if you have the `setenv' function. */ ++#cmakedefine HAVE_SETENV 1 ++ ++/* Define to 1 if you have the `setlocale' function. */ ++#cmakedefine HAVE_SETLOCALE 1 ++ ++/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ ++#cmakedefine HAVE_SIGNED_SIG_ATOMIC_T 1 ++ ++/* Define to 1 if 'wchar_t' is a signed integer type. */ ++#cmakedefine HAVE_SIGNED_WCHAR_T 1 ++ ++/* Define to 1 if 'wint_t' is a signed integer type. */ ++#cmakedefine HAVE_SIGNED_WINT_T 1 ++ ++/* Define to 1 if the system has the type `sigset_t'. */ ++#cmakedefine HAVE_SIGSET_T 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_STDINT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_STDLIB_H 1 ++ ++/* Define to 1 if you have the `strerror_r' function. */ ++#cmakedefine HAVE_STRERROR_R 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_STRINGS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_STRING_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_BITYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_INTTYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_PARAM_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_SOCKET_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_STAT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_TIME_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_SYS_TYPES_H 1 ++ ++/* Define to 1 if you have the `tsearch' function. */ ++#cmakedefine HAVE_TSEARCH 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_UNISTD_H 1 ++ ++/* Define to 1 if the system has the type `unsigned long long int'. */ ++#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT 1 ++ ++/* Define to 1 or 0, depending whether the compiler supports simple visibility ++ declarations. */ ++#cmakedefine HAVE_VISIBILITY 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_WCHAR_H 1 ++ ++/* Define if you have the 'wchar_t' type. */ ++#cmakedefine HAVE_WCHAR_T 1 ++ ++/* Define to 1 if you have the `wcrtomb' function. */ ++#cmakedefine HAVE_WCRTOMB 1 ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine HAVE_WINSOCK2_H 1 ++ ++/* Define to 1 if O_NOATIME works. */ ++#cmakedefine HAVE_WORKING_O_NOATIME 1 ++ ++/* Define to 1 if O_NOFOLLOW works. */ ++#define HAVE_WORKING_O_NOFOLLOW @HAVE_WORKING_O_NOFOLLOW@ ++ ++/* Define to 1 if the system has the type `_Bool'. */ ++#cmakedefine HAVE__BOOL 1 ++ ++/* Define to 1 if you have the `_NSGetExecutablePath' function. */ ++#cmakedefine HAVE__NSGETEXECUTABLEPATH 1 ++ ++/* Define as const if the declaration of iconv() needs const. */ ++#define ICONV_CONST @ICONV_CONST@ ++ ++/* Define to the value of ${prefix}, as a string. */ ++#cmakedefine INSTALLPREFIX "@INSTALLPREFIX@" ++ ++/* Define to 1 if `lstat' dereferences a symlink specified with a trailing ++ slash. */ ++#cmakedefine LSTAT_FOLLOWS_SLASHED_SYMLINK 1 ++ ++/* Define to the sub-directory in which libtool stores uninstalled libraries. ++ */ ++#cmakedefine LT_OBJDIR "@LT_OBJDIR@" ++ ++/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ ++#cmakedefine MALLOC_0_IS_NONNULL 1 ++ ++/* Define to 1 if your C compiler doesn't accept -c and -o together. */ ++#cmakedefine NO_MINUS_C_MINUS_O 1 ++ ++/* Name of package */ ++#cmakedefine PACKAGE "@PACKAGE@" ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" ++ ++/* Define to the full name of this package. */ ++#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" ++ ++/* Define to the full name and version of this package. */ ++#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" ++ ++/* Define to the one symbol short name of this package. */ ++#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" ++ ++/* Define to the home page for this package. */ ++#cmakedefine PACKAGE_URL "@PACKAGE_URL@" ++ ++/* Define to the version of this package. */ ++#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" ++ ++/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type ++ 'ptrdiff_t'. */ ++#cmakedefine PTRDIFF_T_SUFFIX @PTRDIFF_T_SUFFIX@ ++ ++/* Define to 1 if readlink fails to recognize a trailing slash. */ ++#cmakedefine READLINK_TRAILING_SLASH_BUG 1 ++ ++/* Define to 1 if stat needs help when passed a directory name with a trailing ++ slash */ ++#cmakedefine REPLACE_FUNC_STAT_DIR 1 ++ ++/* Define to 1 if stat needs help when passed a file name with a trailing ++ slash */ ++#cmakedefine REPLACE_FUNC_STAT_FILE 1 ++ ++/* Define to 1 if strerror(0) does not return a message implying success. */ ++#cmakedefine REPLACE_STRERROR_0 1 ++ ++/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type ++ 'sig_atomic_t'. */ ++#cmakedefine SIG_ATOMIC_T_SUFFIX @SIG_ATOMIC_T_SUFFIX@ ++ ++/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type ++ 'size_t'. */ ++#cmakedefine SIZE_T_SUFFIX @SIZE_T_SUFFIX@ ++ ++/* If using the C implementation of alloca, define if you know the ++ direction of stack growth for your system; otherwise it will be ++ automatically deduced at runtime. ++ STACK_DIRECTION > 0 => grows toward higher addresses ++ STACK_DIRECTION < 0 => grows toward lower addresses ++ STACK_DIRECTION = 0 => direction of growth unknown */ ++#cmakedefine STACK_DIRECTION @STACK_DIRECTION@ ++ ++/* Define to 1 if the `S_IS*' macros in do not work properly. */ ++#cmakedefine STAT_MACROS_BROKEN 1 ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#cmakedefine STDC_HEADERS 1 ++ ++/* Define to 1 if strerror_r returns char *. */ ++#cmakedefine STRERROR_R_CHAR_P 1 ++ ++/* Define to the prefix of C symbols at the assembler and linker level, either ++ an underscore or empty. */ ++#cmakedefine USER_LABEL_PREFIX @USER_LABEL_PREFIX@ ++ ++/* Define to 1 if you want getc etc. to use unlocked I/O if available. ++ Unlocked I/O can improve performance in unithreaded apps, but it is not ++ safe for multithreaded apps. */ ++#cmakedefine USE_UNLOCKED_IO 1 ++ ++/* Version number of package */ ++#cmakedefine VERSION "@VERSION@" ++ ++/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type ++ 'wchar_t'. */ ++#cmakedefine WCHAR_T_SUFFIX @WCHAR_T_SUFFIX@ ++ ++/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type ++ 'wint_t'. */ ++#cmakedefine WINT_T_SUFFIX @WINT_T_SUFFIX@ ++ ++/* Define if the machine's byte ordering is little endian. */ ++#cmakedefine WORDS_LITTLEENDIAN 1 ++ ++/* Define to 1 if on MINIX. */ ++#cmakedefine _MINIX 1 ++ ++/* The _Noreturn keyword of draft C1X. */ ++#ifndef _Noreturn ++# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ ++ || 0x5110 <= __SUNPRO_C) ++# define _Noreturn __attribute__ ((__noreturn__)) ++# elif 1200 <= _MSC_VER ++# define _Noreturn __declspec (noreturn) ++# else ++# define _Noreturn ++# endif ++#endif ++ ++ ++/* Define to 2 if the system does not provide POSIX.1 features except with ++ this defined. */ ++#cmakedefine _POSIX_1_SOURCE 2 ++ ++/* Define to 1 if you need to in order for `stat' and other things to work. */ ++#cmakedefine _POSIX_SOURCE 1 ++ ++/* Define to 500 only on HP-UX. */ ++#cmakedefine _XOPEN_SOURCE 500 ++ ++/* Enable extensions on AIX 3, Interix. */ ++#ifndef _ALL_SOURCE ++# undef _ALL_SOURCE ++#endif ++/* Enable general extensions on MacOS X. */ ++#ifndef _DARWIN_C_SOURCE ++# undef _DARWIN_C_SOURCE ++#endif ++/* Enable GNU extensions on systems that have them. */ ++#ifndef _GNU_SOURCE ++# undef _GNU_SOURCE ++#endif ++/* Enable threading extensions on Solaris. */ ++#ifndef _POSIX_PTHREAD_SEMANTICS ++# undef _POSIX_PTHREAD_SEMANTICS ++#endif ++/* Enable extensions on HP NonStop. */ ++#ifndef _TANDEM_SOURCE ++# undef _TANDEM_SOURCE ++#endif ++/* Enable general extensions on Solaris. */ ++#ifndef __EXTENSIONS__ ++# undef __EXTENSIONS__ ++#endif ++ ++ ++/* Define to `int' if doesn't define. */ ++#cmakedefine gid_t @GID_T@ ++ ++/* Define to `__inline__' or `__inline' if that's what the C compiler ++ calls it, or to nothing if 'inline' is not supported under any name. */ ++#ifndef __cplusplus ++#undef inline ++#endif ++ ++/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports ++ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of ++ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. ++ __APPLE__ && __MACH__ test for MacOS X. ++ __APPLE_CC__ tests for the Apple compiler and its version. ++ __STDC_VERSION__ tests for the C99 mode. */ ++#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ ++# define __GNUC_STDC_INLINE__ 1 ++#endif ++ ++/* Define to a type if does not define. */ ++#cmakedefine mbstate_t @MBSTATE_T@ ++ ++/* Define to the type of st_nlink in struct stat, or a supertype. */ ++#cmakedefine nlink_t @MBSTATE_T@ ++ ++/* Define to the equivalent of the C99 'restrict' keyword, or to ++ nothing if this is not supported. Do not define if restrict is ++ supported directly. */ ++#cmakedefine restrict ++/* Work around a bug in Sun C++: it does not support _Restrict or ++ __restrict__, even though the corresponding Sun C compiler ends up with ++ "#define restrict _Restrict" or "#define restrict __restrict__" in the ++ previous line. Perhaps some future version of Sun C++ will work with ++ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ ++#if defined __SUNPRO_CC && !defined __RESTRICT ++# define _Restrict ++# define __restrict__ ++#endif ++ ++/* Define to `unsigned int' if does not define. */ ++#cmakedefine size_t @SIZE_T@ ++ ++/* Define as a signed type of the same size as size_t. */ ++#cmakedefine ssize_t @SSIZE_T@ ++ ++/* Define to `int' if doesn't define. */ ++#cmakedefine uid_t @UID_T@ ++ ++/* Define as a marker that can be attached to declarations that might not ++ be used. This helps to reduce warnings, such as from ++ GCC -Wunused-parameter. */ ++#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) ++# define _GL_UNUSED __attribute__ ((__unused__)) ++#else ++# define _GL_UNUSED ++#endif ++/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name ++ is a misnomer outside of parameter lists. */ ++#define _UNUSED_PARAMETER_ _GL_UNUSED ++ ++/* The __pure__ attribute was added in gcc 2.96. */ ++#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) ++# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) ++#else ++# define _GL_ATTRIBUTE_PURE /* empty */ ++#endif ++ ++/* The __const__ attribute was added in gcc 2.95. */ ++#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) ++# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) ++#else ++# define _GL_ATTRIBUTE_CONST /* empty */ ++#endif ++ ++ ++ ++/* On Windows, variables that may be in a DLL must be marked specially. */ ++#if defined _MSC_VER && defined _DLL ++# define DLL_VARIABLE __declspec (dllimport) ++#else ++# define DLL_VARIABLE ++#endif ++ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/configure.cmake.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/configure.cmake.patch new file mode 100644 index 0000000000000000000000000000000000000000..1375d852b3b2bb0d682db6cdf6e82b226f0b6f35 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/configure.cmake.patch @@ -0,0 +1,283 @@ +--- configure.cmake 1970-01-01 10:00:00.000000000 +1000 ++++ configure.cmake 2016-06-07 16:19:29.901351600 +1000 +@@ -0,0 +1,280 @@ ++# Simulate autotools detection for config generation ++# This insanity is needed for autotools infected packages ++ ++# Type checks ++include ( CheckTypeSize ) ++check_type_size ( ptrdiff_t SIZEOF_PTRDIFF_T ) ++if ( SIZEOF_PTRDIFF_T ) ++ math ( EXPR BITSIZEOF_PTRDIFF_T "${SIZEOF_PTRDIFF_T} * 8" ) ++endif () ++ ++set ( CMAKE_EXTRA_INCLUDE_FILES signal.h ) ++check_type_size ( sig_atomic_t SIZEOF_SIG_ATOMIC_T ) ++if ( SIZEOF_SIG_ATOMIC_T ) ++ math ( EXPR BITSIZEOF_SIG_ATOMIC_T "${SIZEOF_SIG_ATOMIC_T} * 8" ) ++endif () ++ ++check_type_size ( size_t SIZEOF_SIZE_T ) ++if ( SIZEOF_SIZE_T ) ++ math ( EXPR BITSIZEOF_SIZE_T "${SIZEOF_SIZE_T} * 8" ) ++endif () ++ ++set ( CMAKE_EXTRA_INCLUDE_FILES wchar.h ) ++check_type_size ( wchar_t SIZEOF_WCHAR_T ) ++if ( SIZEOF_WCHAR_T ) ++ set ( HAVE_WCHAR_T 1) ++ math ( EXPR BITSIZEOF_WCHAR_T "${SIZEOF_WCHAR_T} * 8" ) ++endif () ++ ++check_type_size ( wint_t SIZEOF_WINT_T ) ++if ( SIZEOF_WINT_T ) ++ math ( EXPR BITSIZEOF_WINT_T "${SIZEOF_WINT_T} * 8" ) ++endif () ++ ++check_type_size ( "long long int" HAVE_LONG_LONG_INT ) ++check_type_size ( "unsigned long long int" HAVE_UNSIGNED_LONG_LONG_INT ) ++check_type_size ( _Bool HAVE__BOOL ) ++ ++# Header checks ++include ( CheckIncludeFiles ) ++check_include_files ( alloca.h HAVE_ALLOCA_H ) ++check_include_files ( dlfcn.h HAVE_DLFCN_H ) ++check_include_files ( inttypes.h HAVE_INTTYPES_H ) ++check_include_files ( mach-o/dyld.h HAVE_MACH_O_DYLD_H ) ++check_include_files ( memory.h HAVE_MEMORY_H ) ++check_include_files ( search.h HAVE_SEARCH_H ) ++check_include_files ( stdint.h HAVE_STDINT_H ) ++check_include_files ( stdlib.h HAVE_STDLIB_H ) ++check_include_files ( strings.h HAVE_STRINGS_H ) ++check_include_files ( string.h HAVE_STRING_H ) ++check_include_files ( sys/bitypes.h HAVE_SYS_BITYPES_H ) ++check_include_files ( sys/inttypes.h HAVE_SYS_INTTYPES_H ) ++check_include_files ( sys/param.h HAVE_SYS_PARAM_H ) ++check_include_files ( sys/socket.h HAVE_SYS_SOCKET_H ) ++check_include_files ( sys/stat.h HAVE_SYS_STAT_H ) ++check_include_files ( sys/time.h HAVE_SYS_TIME_H ) ++check_include_files ( sys/types.h HAVE_SYS_TYPES_H ) ++check_include_files ( unistd.h HAVE_UNISTD_H ) ++check_include_files ( wchar.h HAVE_WCHAR_H ) ++check_include_files ( winsock2.h HAVE_WINSOCK2_H ) ++ ++# Function checks ++include ( CheckFunctionExists ) ++check_function_exists ( canonicalize_file_name HAVE_CANONICALIZE_FILE_NAME ) ++check_function_exists ( dcgettext HAVE_DCGETTEXT ) ++check_function_exists ( gettext HAVE_GETTEXT ) ++check_function_exists ( iconv HAVE_ICONV ) ++check_function_exists ( lstat HAVE_LSTAT ) ++check_function_exists ( mbrtowc HAVE_MBRTOWC ) ++check_function_exists ( mbsinit HAVE_MBSINIT ) ++check_function_exists ( memmove HAVE_MEMMOVE ) ++check_function_exists ( atoll HAVE_RAW_DECL_ATOLL ) ++check_function_exists ( chown HAVE_RAW_DECL_CHOWN ) ++check_function_exists ( dprintf HAVE_RAW_DECL_DPRINTF ) ++check_function_exists ( dup2 HAVE_RAW_DECL_DUP2 ) ++check_function_exists ( dup3 HAVE_RAW_DECL_DUP3 ) ++check_function_exists ( endusershell HAVE_RAW_DECL_ENDUSERSHELL ) ++check_function_exists ( environ HAVE_RAW_DECL_ENVIRON ) ++check_function_exists ( euidaccess HAVE_RAW_DECL_EUIDACCESS ) ++check_function_exists ( faccessat HAVE_RAW_DECL_FACCESSAT ) ++check_function_exists ( fchdir HAVE_RAW_DECL_FCHDIR ) ++check_function_exists ( fchmodat HAVE_RAW_DECL_FCHMODAT ) ++check_function_exists ( fchownat HAVE_RAW_DECL_FCHOWNAT ) ++check_function_exists ( fcntl HAVE_RAW_DECL_FCNTL ) ++check_function_exists ( ffsl HAVE_RAW_DECL_FFSL ) ++check_function_exists ( ffsll HAVE_RAW_DECL_FFSLL ) ++check_function_exists ( fpurge HAVE_RAW_DECL_FPURGE ) ++check_function_exists ( fseeko HAVE_RAW_DECL_FSEEKO ) ++check_function_exists ( fstatat HAVE_RAW_DECL_FSTATAT ) ++check_function_exists ( fsync HAVE_RAW_DECL_FSYNC ) ++check_function_exists ( ftello HAVE_RAW_DECL_FTELLO ) ++check_function_exists ( ftruncate HAVE_RAW_DECL_FTRUNCATE ) ++check_function_exists ( futimens HAVE_RAW_DECL_FUTIMENS ) ++check_function_exists ( getcwd HAVE_RAW_DECL_GETCWD ) ++check_function_exists ( getdelim HAVE_RAW_DECL_GETDELIM ) ++check_function_exists ( getdomainname HAVE_RAW_DECL_GETDOMAINNAME ) ++check_function_exists ( canonicalize_file_name HAVE_RAW_DECL_CANONICALIZE_FILE_NAME ) ++check_function_exists ( getdtablesize HAVE_RAW_DECL_GETDTABLESIZE ) ++check_function_exists ( getgroups HAVE_RAW_DECL_GETGROUPS ) ++check_function_exists ( gethostname HAVE_RAW_DECL_GETHOSTNAME ) ++check_function_exists ( getline HAVE_RAW_DECL_GETLINE ) ++check_function_exists ( getloadavg HAVE_RAW_DECL_GETLOADAVG ) ++check_function_exists ( getlogin HAVE_RAW_DECL_GETLOGIN ) ++check_function_exists ( getlogin_r HAVE_RAW_DECL_GETLOGIN_R ) ++check_function_exists ( getpagesize HAVE_RAW_DECL_GETPAGESIZE ) ++check_function_exists ( getsubopt HAVE_RAW_DECL_GETSUBOPT ) ++check_function_exists ( getusershell HAVE_RAW_DECL_GETUSERSHELL ) ++check_function_exists ( grantpt HAVE_RAW_DECL_GRANTPT ) ++check_function_exists ( group_member HAVE_RAW_DECL_GROUP_MEMBER ) ++check_function_exists ( initstat_r HAVE_RAW_DECL_INITSTAT_R ) ++check_function_exists ( lchmod HAVE_RAW_DECL_LCHMOD ) ++check_function_exists ( lchown HAVE_RAW_DECL_LCHOWN ) ++check_function_exists ( link HAVE_RAW_DECL_LINK ) ++check_function_exists ( linkat HAVE_RAW_DECL_LINKAT ) ++check_function_exists ( lseek HAVE_RAW_DECL_LSEEK ) ++check_function_exists ( lstat HAVE_RAW_DECL_LSTAT ) ++check_function_exists ( memmem HAVE_RAW_DECL_MEMMEM ) ++check_function_exists ( mempcpy HAVE_RAW_DECL_MEMPCPY ) ++check_function_exists ( memrchr HAVE_RAW_DECL_MEMRCHR ) ++check_function_exists ( mkdirat HAVE_RAW_DECL_MKDIRAT ) ++check_function_exists ( mkdtemp HAVE_RAW_DECL_MKDTEMP ) ++check_function_exists ( mkfifo HAVE_RAW_DECL_MKFIFO ) ++check_function_exists ( mkfifoat HAVE_RAW_DECL_MKFIFOAT ) ++check_function_exists ( mknod HAVE_RAW_DECL_MKNOD ) ++check_function_exists ( mknodat HAVE_RAW_DECL_MKNODAT ) ++check_function_exists ( mkostemp HAVE_RAW_DECL_MKOSTEMP ) ++check_function_exists ( mkostemps HAVE_RAW_DECL_MKOSTEMPS ) ++check_function_exists ( openat HAVE_RAW_DECL_OPENAT ) ++check_function_exists ( pipe HAVE_RAW_DECL_PIPE ) ++check_function_exists ( pipe2 HAVE_RAW_DECL_PIPE2 ) ++check_function_exists ( popen HAVE_RAW_DECL_POPEN ) ++check_function_exists ( pread HAVE_RAW_DECL_PREAD ) ++check_function_exists ( pthread_sigmask HAVE_RAW_DECL_PTHREAD_SIGMASK ) ++check_function_exists ( ptsname HAVE_RAW_DECL_PTSNAME ) ++check_function_exists ( pwrite HAVE_RAW_DECL_PWRITE ) ++check_function_exists ( random_r HAVE_RAW_DECL_RANDOM_R ) ++check_function_exists ( rawmemchr HAVE_RAW_DECL_RAWMEMCHR ) ++check_function_exists ( readlink HAVE_RAW_DECL_READLINK ) ++check_function_exists ( readlinkat HAVE_RAW_DECL_READLINKAT ) ++check_function_exists ( realpath HAVE_RAW_DECL_REALPATH ) ++check_function_exists ( renameat HAVE_RAW_DECL_RENAMEAT ) ++check_function_exists ( rmdir HAVE_RAW_DECL_RMDIR ) ++check_function_exists ( rpmatch HAVE_RAW_DECL_RPMATCH ) ++check_function_exists ( setenv HAVE_RAW_DECL_SETENV ) ++check_function_exists ( setstate_r HAVE_RAW_DECL_SETSTATE_R ) ++check_function_exists ( setusershell HAVE_RAW_DECL_SETUSERSHELL ) ++check_function_exists ( sigaction HAVE_RAW_DECL_SIGACTION ) ++check_function_exists ( sigaddset HAVE_RAW_DECL_SIGADDSET ) ++check_function_exists ( sigdelset HAVE_RAW_DECL_SIGDELSET ) ++check_function_exists ( sigemptyset HAVE_RAW_DECL_SIGEMPTYSET ) ++check_function_exists ( sigfillset HAVE_RAW_DECL_SIGFILLSET ) ++check_function_exists ( sigismember HAVE_RAW_DECL_SIGISMEMBER ) ++check_function_exists ( sigpending HAVE_RAW_DECL_SIGPENDING ) ++check_function_exists ( sigprocmask HAVE_RAW_DECL_SIGPROCMASK ) ++check_function_exists ( sleep HAVE_RAW_DECL_SLEEP ) ++check_function_exists ( snprintf HAVE_RAW_DECL_SNPRINTF ) ++check_function_exists ( srandom_r HAVE_RAW_DECL_SRANDOM_R ) ++check_function_exists ( stat HAVE_RAW_DECL_STAT ) ++check_function_exists ( stpcpy HAVE_RAW_DECL_STPCPY ) ++check_function_exists ( stpncpy HAVE_RAW_DECL_STPNCPY ) ++check_function_exists ( strcasestr HAVE_RAW_DECL_STRCASESTR ) ++check_function_exists ( strchrnul HAVE_RAW_DECL_STRCHRNUL ) ++check_function_exists ( strdup HAVE_RAW_DECL_STRDUP ) ++check_function_exists ( strerror_r HAVE_RAW_DECL_STRERROR_R ) ++check_function_exists ( strncat HAVE_RAW_DECL_STRNCAT ) ++check_function_exists ( strndup HAVE_RAW_DECL_STRNDUP ) ++check_function_exists ( strnlen HAVE_RAW_DECL_STRNLEN ) ++check_function_exists ( strpbrk HAVE_RAW_DECL_STRSEP ) ++check_function_exists ( strsignal HAVE_RAW_DECL_STRSIGNAL ) ++check_function_exists ( strtod HAVE_RAW_DECL_STRTOD ) ++check_function_exists ( strtok_r HAVE_RAW_DECL_STRTOK_R ) ++check_function_exists ( strtoll HAVE_RAW_DECL_STRTOLL ) ++check_function_exists ( strtoull HAVE_RAW_DECL_STRTOULL ) ++check_function_exists ( strverscmp HAVE_RAW_DECL_STRVERSCMP ) ++check_function_exists ( symlink HAVE_RAW_DECL_SYMLINK ) ++check_function_exists ( symlinkat HAVE_RAW_DECL_SYMLINKAT ) ++check_function_exists ( tmpfile HAVE_RAW_DECL_TMPFILE ) ++check_function_exists ( ttyname_r HAVE_RAW_DECL_TTYNAME_R ) ++check_function_exists ( unlink HAVE_RAW_DECL_UNLINK ) ++check_function_exists ( unlinkat HAVE_RAW_DECL_UNLINKAT ) ++check_function_exists ( unlockpt HAVE_RAW_DECL_UNLOCKPT ) ++check_function_exists ( unsetenv HAVE_RAW_DECL_UNSETENV ) ++check_function_exists ( usleep HAVE_RAW_DECL_USLEEP ) ++check_function_exists ( utimensat HAVE_RAW_DECL_UTIMENSAT ) ++check_function_exists ( vdprintf HAVE_RAW_DECL_VDPRINTF ) ++check_function_exists ( vsnprintf HAVE_RAW_DECL_VSNPRINTF ) ++check_function_exists ( _Exit HAVE_RAW_DECL__EXIT ) ++check_function_exists ( readlink HAVE_READLINK ) ++check_function_exists ( readlinkat HAVE_READLINKAT ) ++check_function_exists ( realpath HAVE_REALPATH ) ++check_function_exists ( setenv HAVE_SETENV ) ++check_function_exists ( setlocale HAVE_SETLOCALE ) ++check_function_exists ( strerror_r HAVE_STRERROR_R ) ++check_function_exists ( tsearch HAVE_TSEARCH ) ++check_function_exists ( wcrtomb HAVE_WCRTOMB ) ++check_function_exists ( _NSGetExecutablePath HAVE__NSGETEXECUTABLEPATH ) ++ ++# Symbols ++include ( CheckSymbolExists ) ++check_symbol_exists ( alloca "alloca.h" HAVE_ALLOCA ) ++check_symbol_exists ( clearerr_unlocked "stdio.h" HAVE_DECL_CLEARERR_UNLOCKED ) ++check_symbol_exists ( feof_unlocked "stdio.h" HAVE_DECL_FEOF_UNLOCKED ) ++check_symbol_exists ( ferror_unlocked "stdio.h" HAVE_DECL_FERROR_UNLOCKED ) ++check_symbol_exists ( fflush_unlocked "stdio.h" HAVE_DECL_FFLUSH_UNLOCKED ) ++check_symbol_exists ( fgets_unlocked "stdio.h" HAVE_DECL_FGETS_UNLOCKED ) ++check_symbol_exists ( fputc_unlocked "stdio.h" HAVE_DECL_FPUTC_UNLOCKED ) ++check_symbol_exists ( fputs_unlocked "stdio.h" HAVE_DECL_FPUTS_UNLOCKED ) ++check_symbol_exists ( fread_unlocked "stdio.h" HAVE_DECL_FREAD_UNLOCKED ) ++check_symbol_exists ( fwrite_unlocked "stdio.h" HAVE_DECL_FWRITE_UNLOCKED ) ++check_symbol_exists ( getchar_unlocked "stdio.h" HAVE_DECL_GETCHAR_UNLOCKED ) ++check_symbol_exists ( getc_unlocked "stdio.h" HAVE_DECL_GETC_UNLOCKED ) ++check_symbol_exists ( program_invocation_name "stdio.h" HAVE_DECL_PROGRAM_INVOCATION_NAME ) ++check_symbol_exists ( program_invocation_short_name "stdio.h" HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME ) ++check_symbol_exists ( putchar_unlocked "stdio.h" HAVE_DECL_PUTCHAR_UNLOCKED ) ++check_symbol_exists ( putc_unlocked "stdio.h" HAVE_DECL_PUTC_UNLOCKED ) ++check_symbol_exists ( setenv "stdlib.h" HAVE_DECL_SETENV ) ++check_symbol_exists ( strerror_r "string.h" HAVE_DECL_STRERROR_R ) ++check_symbol_exists ( environ "unistd.h" HAVE_ENVIRON_DECL ) ++check_symbol_exists ( getcwd "unistd.h" HAVE_GETCWD ) ++check_symbol_exists ( getc_unlocked "stdio.h" HAVE_GETC_UNLOCKED ) ++check_symbol_exists ( nl_langinfo "langinfo.h" HAVE_LANGINFO_CODESET ) ++check_symbol_exists ( mbstate_t "wchar.h" HAVE_MBSTATE_T ) ++ ++# Other ++if ( APPLE ) ++ set ( HAVE_CFLOCALECOPYCURRENT 1 ) ++ set ( HAVE_CFPREFERENCESCOPYAPPVALUE 1 ) ++ set ( HAVE__NSGETEXECUTABLEPATH 1 ) ++endif () ++ ++# From dist.info ++set ( PACKAGE "${DIST_NAME}" ) ++set ( PACKAGE_BUGREPORT "https://github.com/LuaDist/Repository/issues" ) ++set ( PACKAGE_NAME "${DIST_NAME}-${DIST_VERSION}" ) ++set ( PACKAGE_STRING "iconv" ) ++set ( PACKAGE_TARNAME "${DIST_NAME}-${DIST_VERSION}.dist" ) ++set ( PACKAGE_URL "${DIST_URL}" ) ++set ( PACKAGE_VERSION "${DIST_VERSION}" ) ++ ++set ( INSTALLPREFIX "" ) ++set ( HAVE_SIGNED_WCHAR_T 1) ++set ( HAVE_SIGNED_SIG_ATOMIC_T 1 ) ++set ( HAVE_SIGNED_WINT_T 1) ++set ( HAVE_SIGSET_T ) ++ ++set ( HAVE_VISIBILITY 0 ) ++set ( ICONV_CONST "" ) ++set ( INSTALLPREFIX "" ) ++set ( MALLOC_0_IS_NONNULL 1 ) ++set ( HAVE_WORKING_O_NOATIME 0 ) ++set ( HAVE_WORKING_O_NOFOLLOW 1 ) ++set ( LSTAT_FOLLOWS_SLASHED_SYMLINK 0 ) ++set ( PTRDIFF_T_SUFFIX l ) ++set ( READLINK_TRAILING_SLASH_BUG 1 ) ++set ( REPLACE_FUNC_STAT_DIR 0 ) ++set ( REPLACE_FUNC_STAT_FILE 1 ) ++set ( REPLACE_STRERROR_0 1 ) ++set ( SIG_ATOMIC_T_SUFFIX 1 ) ++set ( SIZE_T_SUFFIX ul ) ++set ( STDC_HEADERS 1 ) ++set ( STRERROR_R_CHAR_P 0 ) ++set ( USER_LABEL_PREFIX _ ) ++set ( USE_UNLOCKED_IO 1 ) ++set ( VERSION "${DIST_VERSION}" ) ++set ( WCHAR_T_SUFFIX "" ) ++set ( WINT_T_SUFFIX "" ) ++set ( WORDS_LITTLEENDIAN 1 ) ++ ++# GNULIB settings ++set ( GNULIB_CANONICALIZE_LGPL 1 ) ++set ( GNULIB_SIGPIPE 1 ) ++set ( GNULIB_STRERROR 1 ) ++set ( GNULIB_TEST_CANONICALIZE_FILE_NAME 1 ) ++set ( GNULIB_TEST_ENVIRON 1 ) ++set ( GNULIB_TEST_LSTAT 1 ) ++set ( GNULIB_TEST_READ 1 ) ++set ( GNULIB_TEST_READLINK 1 ) ++set ( GNULIB_TEST_REALPATH 1 ) ++set ( GNULIB_TEST_SIGPROCMASK 1 ) ++set ( GNULIB_TEST_STAT 1 ) ++set ( GNULIB_TEST_STRERROR 1 ) diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/fix-aclocal-exact-tool-pin.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/fix-aclocal-exact-tool-pin.patch new file mode 100644 index 0000000000000000000000000000000000000000..22c12fb94eea0e1fd43560e305f0a7a85699e69b --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/fix-aclocal-exact-tool-pin.patch @@ -0,0 +1,27 @@ +From 47f4256fa9c180d34d9a5ec1b6eaf1c207f7cb94 Mon Sep 17 00:00:00 2001 +From: "Viacheslav Ch." +Date: Thu, 12 Feb 2026 12:49:22 +0200 +Subject: [PATCH] fix aclocal exact tool pin + +--- + Makefile.devel | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.devel b/Makefile.devel +index baee4ba..345a835 100644 +--- a/Makefile.devel ++++ b/Makefile.devel +@@ -13,8 +13,8 @@ SHELL = /bin/sh + MAKE = make + AUTOCONF = autoconf + AUTOHEADER = autoheader +-AUTOMAKE = automake-1.17 +-ACLOCAL = aclocal-1.17 ++AUTOMAKE = automake ++ACLOCAL = aclocal + GPERF = gperf + + # Ignore the built-in default for CC. Also ignore $(CC) if it is empty. +-- +2.50.1 (Apple Git-155) + diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/glibc.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/glibc.patch new file mode 100644 index 0000000000000000000000000000000000000000..00793c238670d18f532c466ec22877ffe320442a --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/glibc.patch @@ -0,0 +1,13 @@ +--- libiconv-1.15.orig/srclib/stdio.in.h 2017-01-01 21:02:22.000000000 -0200 ++++ libiconv-1.15/srclib/stdio.in.h 2017-11-23 11:17:28.989995583 -0200 +@@ -744,7 +744,9 @@ + removed it. */ + #undef gets + #if HAVE_RAW_DECL_GETS && !defined __cplusplus +-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#if defined(__GLIBC__) && !defined(__UCLIBC__) && (!defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 16)) ++ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#endif + #endif + + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/utf_8_mac.patch b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/utf_8_mac.patch new file mode 100644 index 0000000000000000000000000000000000000000..739dd4e78feb3b576ae4c3857adb346eff2beb57 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/recipe/parent/patches/utf_8_mac.patch @@ -0,0 +1,1664 @@ +From 153171238f2af82fec32b4c9c86e5defa747e003 Mon Sep 17 00:00:00 2001 +From: Marcel Bargull +Date: Fri, 15 Dec 2023 21:23:54 +0100 +Subject: [PATCH] Add UTF-8-MAC encoding from Apple libiconv sources + +This adds utf8mac.h from Apple's libiconv from +https://github.com/apple-oss-distributions/libiconv/blob/libiconv-64/libiconv/lib/utf8mac.h +and registers it as an encoding in lib/encodings.def and lib/converter.h +similar to the patches found at +- https://github.com/fumiyas/libiconv-utf8mac/tree/2677394480f0d67d6f64b74045b9b4ad08097592 +- https://github.com/Homebrew/homebrew-core/blob/9911c3276bcc2a8f2e8a8359370c217e43cd8104/Formula/lib/libiconv.rb#L26 +- https://github.com/macports/macports-ports/blob/f3ba1cfbdb791cd35fdfafb98c06868952451980/textproc/libiconv/files/patch-utf8mac.diff + +Co-authored-by: Matthew R. Becker +Signed-off-by: Marcel Bargull +--- + lib/converters.h | 1 + + lib/encodings.def | 6 + + lib/utf8mac.h | 1607 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 1614 insertions(+) + create mode 100644 lib/utf8mac.h + +diff --git a/lib/converters.h b/lib/converters.h +index e2e2227..76a6267 100644 +--- a/lib/converters.h ++++ b/lib/converters.h +@@ -122,6 +122,7 @@ struct conv_struct { + /* General multi-byte encodings */ + #include "utf8.h" + #include "ucs2.h" ++#include "utf8mac.h" + #include "ucs2be.h" + #include "ucs2le.h" + #include "ucs4.h" +diff --git a/lib/encodings.def b/lib/encodings.def +index 41d8063..e573945 100644 +--- a/lib/encodings.def ++++ b/lib/encodings.def +@@ -68,6 +68,12 @@ DEFALIAS( "UTF8", /* HP-UX */ + utf8) + #endif + ++DEFENCODING(( "UTF-8-MAC", /* utf8-nfd */ ++ "UTF8-MAC", /* label from samba 2.2jp */ ++ ), ++ utf8mac, ++ { utf8mac_mbtowc, NULL }, { utf8mac_wctomb, NULL }) ++ + DEFENCODING(( "UCS-2", /* glibc */ + "ISO-10646-UCS-2", /* IANA */ + "csUnicode", /* IANA */ +diff --git a/lib/utf8mac.h b/lib/utf8mac.h +new file mode 100644 +index 0000000..c5d0f76 +--- /dev/null ++++ b/lib/utf8mac.h +@@ -0,0 +1,1607 @@ ++/* ++ * Copyright (C) 2003, 2013 Apple Computer, Inc. All rights reserved. ++ * ++ * This file is part of the GNU LIBICONV Library. ++ * ++ * The GNU LIBICONV Library is free software; you can redistribute it ++ * and/or modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * The GNU LIBICONV Library is distributed in the hope that it will be ++ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with the GNU LIBICONV Library; see the file COPYING.LIB. ++ * If not, write to the Free Software Foundation, Inc., 59 Temple Place - ++ * Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++/* ++ * UTF-8-MAC ++ */ ++ ++ /* ++ Includes Unicode 3.2 decomposition code derived from Core Foundation ++ */ ++ ++#include ++#include ++ ++#define UTF_REVERSE_ENDIAN 0x01 /* reverse UCS-2 byte order */ ++#define UTF_NO_NULL_TERM 0x02 /* do not add null termination */ ++#define UTF_DECOMPOSED 0x04 /* generate fully decomposed UCS-2 */ ++#define UTF_PRECOMPOSED 0x08 /* generate precomposed UCS-2 */ ++ ++int utf8_encodestr (const u_int16_t *, size_t, u_int8_t *, size_t *, ++ size_t, u_int16_t, int); ++ ++int utf8_decodestr (const u_int8_t *, size_t, u_int16_t *,size_t *, ++ size_t, u_int16_t, int, size_t *); ++ ++/* ++ Derived from Core Foundation headers: ++ ++ CFUniCharDecompData.h ++ CFUniCharPrecompData.h ++ CFUniCharNonBaseData.h ++*/ ++ ++static const u_int16_t ++__CFUniCharDecompositionTable[] = { ++ 0x00C0, 0x2000, 0x00C1, 0x2002, 0x00C2, 0x2004, 0x00C3, 0x2006, ++ 0x00C4, 0x2008, 0x00C5, 0x200A, 0x00C7, 0x200C, 0x00C8, 0x200E, ++ 0x00C9, 0x2010, 0x00CA, 0x2012, 0x00CB, 0x2014, 0x00CC, 0x2016, ++ 0x00CD, 0x2018, 0x00CE, 0x201A, 0x00CF, 0x201C, 0x00D1, 0x201E, ++ 0x00D2, 0x2020, 0x00D3, 0x2022, 0x00D4, 0x2024, 0x00D5, 0x2026, ++ 0x00D6, 0x2028, 0x00D9, 0x202A, 0x00DA, 0x202C, 0x00DB, 0x202E, ++ 0x00DC, 0x2030, 0x00DD, 0x2032, 0x00E0, 0x2034, 0x00E1, 0x2036, ++ 0x00E2, 0x2038, 0x00E3, 0x203A, 0x00E4, 0x203C, 0x00E5, 0x203E, ++ 0x00E7, 0x2040, 0x00E8, 0x2042, 0x00E9, 0x2044, 0x00EA, 0x2046, ++ 0x00EB, 0x2048, 0x00EC, 0x204A, 0x00ED, 0x204C, 0x00EE, 0x204E, ++ 0x00EF, 0x2050, 0x00F1, 0x2052, 0x00F2, 0x2054, 0x00F3, 0x2056, ++ 0x00F4, 0x2058, 0x00F5, 0x205A, 0x00F6, 0x205C, 0x00F9, 0x205E, ++ 0x00FA, 0x2060, 0x00FB, 0x2062, 0x00FC, 0x2064, 0x00FD, 0x2066, ++ 0x00FF, 0x2068, 0x0100, 0x206A, 0x0101, 0x206C, 0x0102, 0x206E, ++ 0x0103, 0x2070, 0x0104, 0x2072, 0x0105, 0x2074, 0x0106, 0x2076, ++ 0x0107, 0x2078, 0x0108, 0x207A, 0x0109, 0x207C, 0x010A, 0x207E, ++ 0x010B, 0x2080, 0x010C, 0x2082, 0x010D, 0x2084, 0x010E, 0x2086, ++ 0x010F, 0x2088, 0x0112, 0x208A, 0x0113, 0x208C, 0x0114, 0x208E, ++ 0x0115, 0x2090, 0x0116, 0x2092, 0x0117, 0x2094, 0x0118, 0x2096, ++ 0x0119, 0x2098, 0x011A, 0x209A, 0x011B, 0x209C, 0x011C, 0x209E, ++ 0x011D, 0x20A0, 0x011E, 0x20A2, 0x011F, 0x20A4, 0x0120, 0x20A6, ++ 0x0121, 0x20A8, 0x0122, 0x20AA, 0x0123, 0x20AC, 0x0124, 0x20AE, ++ 0x0125, 0x20B0, 0x0128, 0x20B2, 0x0129, 0x20B4, 0x012A, 0x20B6, ++ 0x012B, 0x20B8, 0x012C, 0x20BA, 0x012D, 0x20BC, 0x012E, 0x20BE, ++ 0x012F, 0x20C0, 0x0130, 0x20C2, 0x0134, 0x20C4, 0x0135, 0x20C6, ++ 0x0136, 0x20C8, 0x0137, 0x20CA, 0x0139, 0x20CC, 0x013A, 0x20CE, ++ 0x013B, 0x20D0, 0x013C, 0x20D2, 0x013D, 0x20D4, 0x013E, 0x20D6, ++ 0x0143, 0x20D8, 0x0144, 0x20DA, 0x0145, 0x20DC, 0x0146, 0x20DE, ++ 0x0147, 0x20E0, 0x0148, 0x20E2, 0x014C, 0x20E4, 0x014D, 0x20E6, ++ 0x014E, 0x20E8, 0x014F, 0x20EA, 0x0150, 0x20EC, 0x0151, 0x20EE, ++ 0x0154, 0x20F0, 0x0155, 0x20F2, 0x0156, 0x20F4, 0x0157, 0x20F6, ++ 0x0158, 0x20F8, 0x0159, 0x20FA, 0x015A, 0x20FC, 0x015B, 0x20FE, ++ 0x015C, 0x2100, 0x015D, 0x2102, 0x015E, 0x2104, 0x015F, 0x2106, ++ 0x0160, 0x2108, 0x0161, 0x210A, 0x0162, 0x210C, 0x0163, 0x210E, ++ 0x0164, 0x2110, 0x0165, 0x2112, 0x0168, 0x2114, 0x0169, 0x2116, ++ 0x016A, 0x2118, 0x016B, 0x211A, 0x016C, 0x211C, 0x016D, 0x211E, ++ 0x016E, 0x2120, 0x016F, 0x2122, 0x0170, 0x2124, 0x0171, 0x2126, ++ 0x0172, 0x2128, 0x0173, 0x212A, 0x0174, 0x212C, 0x0175, 0x212E, ++ 0x0176, 0x2130, 0x0177, 0x2132, 0x0178, 0x2134, 0x0179, 0x2136, ++ 0x017A, 0x2138, 0x017B, 0x213A, 0x017C, 0x213C, 0x017D, 0x213E, ++ 0x017E, 0x2140, 0x01A0, 0x2142, 0x01A1, 0x2144, 0x01AF, 0x2146, ++ 0x01B0, 0x2148, 0x01CD, 0x214A, 0x01CE, 0x214C, 0x01CF, 0x214E, ++ 0x01D0, 0x2150, 0x01D1, 0x2152, 0x01D2, 0x2154, 0x01D3, 0x2156, ++ 0x01D4, 0x2158, 0x01D5, 0xA15A, 0x01D6, 0xA15C, 0x01D7, 0xA15E, ++ 0x01D8, 0xA160, 0x01D9, 0xA162, 0x01DA, 0xA164, 0x01DB, 0xA166, ++ 0x01DC, 0xA168, 0x01DE, 0xA16A, 0x01DF, 0xA16C, 0x01E0, 0xA16E, ++ 0x01E1, 0xA170, 0x01E2, 0x2172, 0x01E3, 0x2174, 0x01E6, 0x2176, ++ 0x01E7, 0x2178, 0x01E8, 0x217A, 0x01E9, 0x217C, 0x01EA, 0x217E, ++ 0x01EB, 0x2180, 0x01EC, 0xA182, 0x01ED, 0xA184, 0x01EE, 0x2186, ++ 0x01EF, 0x2188, 0x01F0, 0x218A, 0x01F4, 0x218C, 0x01F5, 0x218E, ++ 0x01F8, 0x2190, 0x01F9, 0x2192, 0x01FA, 0xA194, 0x01FB, 0xA196, ++ 0x01FC, 0x2198, 0x01FD, 0x219A, 0x01FE, 0x219C, 0x01FF, 0x219E, ++ 0x0200, 0x21A0, 0x0201, 0x21A2, 0x0202, 0x21A4, 0x0203, 0x21A6, ++ 0x0204, 0x21A8, 0x0205, 0x21AA, 0x0206, 0x21AC, 0x0207, 0x21AE, ++ 0x0208, 0x21B0, 0x0209, 0x21B2, 0x020A, 0x21B4, 0x020B, 0x21B6, ++ 0x020C, 0x21B8, 0x020D, 0x21BA, 0x020E, 0x21BC, 0x020F, 0x21BE, ++ 0x0210, 0x21C0, 0x0211, 0x21C2, 0x0212, 0x21C4, 0x0213, 0x21C6, ++ 0x0214, 0x21C8, 0x0215, 0x21CA, 0x0216, 0x21CC, 0x0217, 0x21CE, ++ 0x0218, 0x21D0, 0x0219, 0x21D2, 0x021A, 0x21D4, 0x021B, 0x21D6, ++ 0x021E, 0x21D8, 0x021F, 0x21DA, 0x0226, 0x21DC, 0x0227, 0x21DE, ++ 0x0228, 0x21E0, 0x0229, 0x21E2, 0x022A, 0xA1E4, 0x022B, 0xA1E6, ++ 0x022C, 0xA1E8, 0x022D, 0xA1EA, 0x022E, 0x21EC, 0x022F, 0x21EE, ++ 0x0230, 0xA1F0, 0x0231, 0xA1F2, 0x0232, 0x21F4, 0x0233, 0x21F6, ++ 0x0340, 0x1300, 0x0341, 0x1301, 0x0343, 0x1313, 0x0344, 0x21F8, ++ 0x0374, 0x12B9, 0x037E, 0x103B, 0x0385, 0x21FA, 0x0386, 0x21FC, ++ 0x0387, 0x10B7, 0x0388, 0x21FE, 0x0389, 0x2200, 0x038A, 0x2202, ++ 0x038C, 0x2204, 0x038E, 0x2206, 0x038F, 0x2208, 0x0390, 0xA20A, ++ 0x03AA, 0x220C, 0x03AB, 0x220E, 0x03AC, 0x2210, 0x03AD, 0x2212, ++ 0x03AE, 0x2214, 0x03AF, 0x2216, 0x03B0, 0xA218, 0x03CA, 0x221A, ++ 0x03CB, 0x221C, 0x03CC, 0x221E, 0x03CD, 0x2220, 0x03CE, 0x2222, ++ 0x03D3, 0x2224, 0x03D4, 0x2226, 0x0400, 0x2228, 0x0401, 0x222A, ++ 0x0403, 0x222C, 0x0407, 0x222E, 0x040C, 0x2230, 0x040D, 0x2232, ++ 0x040E, 0x2234, 0x0419, 0x2236, 0x0439, 0x2238, 0x0450, 0x223A, ++ 0x0451, 0x223C, 0x0453, 0x223E, 0x0457, 0x2240, 0x045C, 0x2242, ++ 0x045D, 0x2244, 0x045E, 0x2246, 0x0476, 0x2248, 0x0477, 0x224A, ++ 0x04C1, 0x224C, 0x04C2, 0x224E, 0x04D0, 0x2250, 0x04D1, 0x2252, ++ 0x04D2, 0x2254, 0x04D3, 0x2256, 0x04D6, 0x2258, 0x04D7, 0x225A, ++ 0x04DA, 0x225C, 0x04DB, 0x225E, 0x04DC, 0x2260, 0x04DD, 0x2262, ++ 0x04DE, 0x2264, 0x04DF, 0x2266, 0x04E2, 0x2268, 0x04E3, 0x226A, ++ 0x04E4, 0x226C, 0x04E5, 0x226E, 0x04E6, 0x2270, 0x04E7, 0x2272, ++ 0x04EA, 0x2274, 0x04EB, 0x2276, 0x04EC, 0x2278, 0x04ED, 0x227A, ++ 0x04EE, 0x227C, 0x04EF, 0x227E, 0x04F0, 0x2280, 0x04F1, 0x2282, ++ 0x04F2, 0x2284, 0x04F3, 0x2286, 0x04F4, 0x2288, 0x04F5, 0x228A, ++ 0x04F8, 0x228C, 0x04F9, 0x228E, 0x0622, 0x2290, 0x0623, 0x2292, ++ 0x0624, 0x2294, 0x0625, 0x2296, 0x0626, 0x2298, 0x06C0, 0x229A, ++ 0x06C2, 0x229C, 0x06D3, 0x229E, 0x0929, 0x22A0, 0x0931, 0x22A2, ++ 0x0934, 0x22A4, 0x0958, 0x22A6, 0x0959, 0x22A8, 0x095A, 0x22AA, ++ 0x095B, 0x22AC, 0x095C, 0x22AE, 0x095D, 0x22B0, 0x095E, 0x22B2, ++ 0x095F, 0x22B4, 0x09CB, 0x22B6, 0x09CC, 0x22B8, 0x09DC, 0x22BA, ++ 0x09DD, 0x22BC, 0x09DF, 0x22BE, 0x0A33, 0x22C0, 0x0A36, 0x22C2, ++ 0x0A59, 0x22C4, 0x0A5A, 0x22C6, 0x0A5B, 0x22C8, 0x0A5E, 0x22CA, ++ 0x0B48, 0x22CC, 0x0B4B, 0x22CE, 0x0B4C, 0x22D0, 0x0B5C, 0x22D2, ++ 0x0B5D, 0x22D4, 0x0B94, 0x22D6, 0x0BCA, 0x22D8, 0x0BCB, 0x22DA, ++ 0x0BCC, 0x22DC, 0x0C48, 0x22DE, 0x0CC0, 0x22E0, 0x0CC7, 0x22E2, ++ 0x0CC8, 0x22E4, 0x0CCA, 0x22E6, 0x0CCB, 0xA2E8, 0x0D4A, 0x22EA, ++ 0x0D4B, 0x22EC, 0x0D4C, 0x22EE, 0x0DDA, 0x22F0, 0x0DDC, 0x22F2, ++ 0x0DDD, 0xA2F4, 0x0DDE, 0x22F6, 0x0F43, 0x22F8, 0x0F4D, 0x22FA, ++ 0x0F52, 0x22FC, 0x0F57, 0x22FE, 0x0F5C, 0x2300, 0x0F69, 0x2302, ++ 0x0F73, 0x2304, 0x0F75, 0x2306, 0x0F76, 0x2308, 0x0F78, 0x230A, ++ 0x0F81, 0x230C, 0x0F93, 0x230E, 0x0F9D, 0x2310, 0x0FA2, 0x2312, ++ 0x0FA7, 0x2314, 0x0FAC, 0x2316, 0x0FB9, 0x2318, 0x1026, 0x231A, ++ 0x1E00, 0x231C, 0x1E01, 0x231E, 0x1E02, 0x2320, 0x1E03, 0x2322, ++ 0x1E04, 0x2324, 0x1E05, 0x2326, 0x1E06, 0x2328, 0x1E07, 0x232A, ++ 0x1E08, 0xA32C, 0x1E09, 0xA32E, 0x1E0A, 0x2330, 0x1E0B, 0x2332, ++ 0x1E0C, 0x2334, 0x1E0D, 0x2336, 0x1E0E, 0x2338, 0x1E0F, 0x233A, ++ 0x1E10, 0x233C, 0x1E11, 0x233E, 0x1E12, 0x2340, 0x1E13, 0x2342, ++ 0x1E14, 0xA344, 0x1E15, 0xA346, 0x1E16, 0xA348, 0x1E17, 0xA34A, ++ 0x1E18, 0x234C, 0x1E19, 0x234E, 0x1E1A, 0x2350, 0x1E1B, 0x2352, ++ 0x1E1C, 0xA354, 0x1E1D, 0xA356, 0x1E1E, 0x2358, 0x1E1F, 0x235A, ++ 0x1E20, 0x235C, 0x1E21, 0x235E, 0x1E22, 0x2360, 0x1E23, 0x2362, ++ 0x1E24, 0x2364, 0x1E25, 0x2366, 0x1E26, 0x2368, 0x1E27, 0x236A, ++ 0x1E28, 0x236C, 0x1E29, 0x236E, 0x1E2A, 0x2370, 0x1E2B, 0x2372, ++ 0x1E2C, 0x2374, 0x1E2D, 0x2376, 0x1E2E, 0xA378, 0x1E2F, 0xA37A, ++ 0x1E30, 0x237C, 0x1E31, 0x237E, 0x1E32, 0x2380, 0x1E33, 0x2382, ++ 0x1E34, 0x2384, 0x1E35, 0x2386, 0x1E36, 0x2388, 0x1E37, 0x238A, ++ 0x1E38, 0xA38C, 0x1E39, 0xA38E, 0x1E3A, 0x2390, 0x1E3B, 0x2392, ++ 0x1E3C, 0x2394, 0x1E3D, 0x2396, 0x1E3E, 0x2398, 0x1E3F, 0x239A, ++ 0x1E40, 0x239C, 0x1E41, 0x239E, 0x1E42, 0x23A0, 0x1E43, 0x23A2, ++ 0x1E44, 0x23A4, 0x1E45, 0x23A6, 0x1E46, 0x23A8, 0x1E47, 0x23AA, ++ 0x1E48, 0x23AC, 0x1E49, 0x23AE, 0x1E4A, 0x23B0, 0x1E4B, 0x23B2, ++ 0x1E4C, 0xA3B4, 0x1E4D, 0xA3B6, 0x1E4E, 0xA3B8, 0x1E4F, 0xA3BA, ++ 0x1E50, 0xA3BC, 0x1E51, 0xA3BE, 0x1E52, 0xA3C0, 0x1E53, 0xA3C2, ++ 0x1E54, 0x23C4, 0x1E55, 0x23C6, 0x1E56, 0x23C8, 0x1E57, 0x23CA, ++ 0x1E58, 0x23CC, 0x1E59, 0x23CE, 0x1E5A, 0x23D0, 0x1E5B, 0x23D2, ++ 0x1E5C, 0xA3D4, 0x1E5D, 0xA3D6, 0x1E5E, 0x23D8, 0x1E5F, 0x23DA, ++ 0x1E60, 0x23DC, 0x1E61, 0x23DE, 0x1E62, 0x23E0, 0x1E63, 0x23E2, ++ 0x1E64, 0xA3E4, 0x1E65, 0xA3E6, 0x1E66, 0xA3E8, 0x1E67, 0xA3EA, ++ 0x1E68, 0xA3EC, 0x1E69, 0xA3EE, 0x1E6A, 0x23F0, 0x1E6B, 0x23F2, ++ 0x1E6C, 0x23F4, 0x1E6D, 0x23F6, 0x1E6E, 0x23F8, 0x1E6F, 0x23FA, ++ 0x1E70, 0x23FC, 0x1E71, 0x23FE, 0x1E72, 0x2400, 0x1E73, 0x2402, ++ 0x1E74, 0x2404, 0x1E75, 0x2406, 0x1E76, 0x2408, 0x1E77, 0x240A, ++ 0x1E78, 0xA40C, 0x1E79, 0xA40E, 0x1E7A, 0xA410, 0x1E7B, 0xA412, ++ 0x1E7C, 0x2414, 0x1E7D, 0x2416, 0x1E7E, 0x2418, 0x1E7F, 0x241A, ++ 0x1E80, 0x241C, 0x1E81, 0x241E, 0x1E82, 0x2420, 0x1E83, 0x2422, ++ 0x1E84, 0x2424, 0x1E85, 0x2426, 0x1E86, 0x2428, 0x1E87, 0x242A, ++ 0x1E88, 0x242C, 0x1E89, 0x242E, 0x1E8A, 0x2430, 0x1E8B, 0x2432, ++ 0x1E8C, 0x2434, 0x1E8D, 0x2436, 0x1E8E, 0x2438, 0x1E8F, 0x243A, ++ 0x1E90, 0x243C, 0x1E91, 0x243E, 0x1E92, 0x2440, 0x1E93, 0x2442, ++ 0x1E94, 0x2444, 0x1E95, 0x2446, 0x1E96, 0x2448, 0x1E97, 0x244A, ++ 0x1E98, 0x244C, 0x1E99, 0x244E, 0x1E9B, 0x2450, 0x1EA0, 0x2452, ++ 0x1EA1, 0x2454, 0x1EA2, 0x2456, 0x1EA3, 0x2458, 0x1EA4, 0xA45A, ++ 0x1EA5, 0xA45C, 0x1EA6, 0xA45E, 0x1EA7, 0xA460, 0x1EA8, 0xA462, ++ 0x1EA9, 0xA464, 0x1EAA, 0xA466, 0x1EAB, 0xA468, 0x1EAC, 0xA46A, ++ 0x1EAD, 0xA46C, 0x1EAE, 0xA46E, 0x1EAF, 0xA470, 0x1EB0, 0xA472, ++ 0x1EB1, 0xA474, 0x1EB2, 0xA476, 0x1EB3, 0xA478, 0x1EB4, 0xA47A, ++ 0x1EB5, 0xA47C, 0x1EB6, 0xA47E, 0x1EB7, 0xA480, 0x1EB8, 0x2482, ++ 0x1EB9, 0x2484, 0x1EBA, 0x2486, 0x1EBB, 0x2488, 0x1EBC, 0x248A, ++ 0x1EBD, 0x248C, 0x1EBE, 0xA48E, 0x1EBF, 0xA490, 0x1EC0, 0xA492, ++ 0x1EC1, 0xA494, 0x1EC2, 0xA496, 0x1EC3, 0xA498, 0x1EC4, 0xA49A, ++ 0x1EC5, 0xA49C, 0x1EC6, 0xA49E, 0x1EC7, 0xA4A0, 0x1EC8, 0x24A2, ++ 0x1EC9, 0x24A4, 0x1ECA, 0x24A6, 0x1ECB, 0x24A8, 0x1ECC, 0x24AA, ++ 0x1ECD, 0x24AC, 0x1ECE, 0x24AE, 0x1ECF, 0x24B0, 0x1ED0, 0xA4B2, ++ 0x1ED1, 0xA4B4, 0x1ED2, 0xA4B6, 0x1ED3, 0xA4B8, 0x1ED4, 0xA4BA, ++ 0x1ED5, 0xA4BC, 0x1ED6, 0xA4BE, 0x1ED7, 0xA4C0, 0x1ED8, 0xA4C2, ++ 0x1ED9, 0xA4C4, 0x1EDA, 0xA4C6, 0x1EDB, 0xA4C8, 0x1EDC, 0xA4CA, ++ 0x1EDD, 0xA4CC, 0x1EDE, 0xA4CE, 0x1EDF, 0xA4D0, 0x1EE0, 0xA4D2, ++ 0x1EE1, 0xA4D4, 0x1EE2, 0xA4D6, 0x1EE3, 0xA4D8, 0x1EE4, 0x24DA, ++ 0x1EE5, 0x24DC, 0x1EE6, 0x24DE, 0x1EE7, 0x24E0, 0x1EE8, 0xA4E2, ++ 0x1EE9, 0xA4E4, 0x1EEA, 0xA4E6, 0x1EEB, 0xA4E8, 0x1EEC, 0xA4EA, ++ 0x1EED, 0xA4EC, 0x1EEE, 0xA4EE, 0x1EEF, 0xA4F0, 0x1EF0, 0xA4F2, ++ 0x1EF1, 0xA4F4, 0x1EF2, 0x24F6, 0x1EF3, 0x24F8, 0x1EF4, 0x24FA, ++ 0x1EF5, 0x24FC, 0x1EF6, 0x24FE, 0x1EF7, 0x2500, 0x1EF8, 0x2502, ++ 0x1EF9, 0x2504, 0x1F00, 0x2506, 0x1F01, 0x2508, 0x1F02, 0xA50A, ++ 0x1F03, 0xA50C, 0x1F04, 0xA50E, 0x1F05, 0xA510, 0x1F06, 0xA512, ++ 0x1F07, 0xA514, 0x1F08, 0x2516, 0x1F09, 0x2518, 0x1F0A, 0xA51A, ++ 0x1F0B, 0xA51C, 0x1F0C, 0xA51E, 0x1F0D, 0xA520, 0x1F0E, 0xA522, ++ 0x1F0F, 0xA524, 0x1F10, 0x2526, 0x1F11, 0x2528, 0x1F12, 0xA52A, ++ 0x1F13, 0xA52C, 0x1F14, 0xA52E, 0x1F15, 0xA530, 0x1F18, 0x2532, ++ 0x1F19, 0x2534, 0x1F1A, 0xA536, 0x1F1B, 0xA538, 0x1F1C, 0xA53A, ++ 0x1F1D, 0xA53C, 0x1F20, 0x253E, 0x1F21, 0x2540, 0x1F22, 0xA542, ++ 0x1F23, 0xA544, 0x1F24, 0xA546, 0x1F25, 0xA548, 0x1F26, 0xA54A, ++ 0x1F27, 0xA54C, 0x1F28, 0x254E, 0x1F29, 0x2550, 0x1F2A, 0xA552, ++ 0x1F2B, 0xA554, 0x1F2C, 0xA556, 0x1F2D, 0xA558, 0x1F2E, 0xA55A, ++ 0x1F2F, 0xA55C, 0x1F30, 0x255E, 0x1F31, 0x2560, 0x1F32, 0xA562, ++ 0x1F33, 0xA564, 0x1F34, 0xA566, 0x1F35, 0xA568, 0x1F36, 0xA56A, ++ 0x1F37, 0xA56C, 0x1F38, 0x256E, 0x1F39, 0x2570, 0x1F3A, 0xA572, ++ 0x1F3B, 0xA574, 0x1F3C, 0xA576, 0x1F3D, 0xA578, 0x1F3E, 0xA57A, ++ 0x1F3F, 0xA57C, 0x1F40, 0x257E, 0x1F41, 0x2580, 0x1F42, 0xA582, ++ 0x1F43, 0xA584, 0x1F44, 0xA586, 0x1F45, 0xA588, 0x1F48, 0x258A, ++ 0x1F49, 0x258C, 0x1F4A, 0xA58E, 0x1F4B, 0xA590, 0x1F4C, 0xA592, ++ 0x1F4D, 0xA594, 0x1F50, 0x2596, 0x1F51, 0x2598, 0x1F52, 0xA59A, ++ 0x1F53, 0xA59C, 0x1F54, 0xA59E, 0x1F55, 0xA5A0, 0x1F56, 0xA5A2, ++ 0x1F57, 0xA5A4, 0x1F59, 0x25A6, 0x1F5B, 0xA5A8, 0x1F5D, 0xA5AA, ++ 0x1F5F, 0xA5AC, 0x1F60, 0x25AE, 0x1F61, 0x25B0, 0x1F62, 0xA5B2, ++ 0x1F63, 0xA5B4, 0x1F64, 0xA5B6, 0x1F65, 0xA5B8, 0x1F66, 0xA5BA, ++ 0x1F67, 0xA5BC, 0x1F68, 0x25BE, 0x1F69, 0x25C0, 0x1F6A, 0xA5C2, ++ 0x1F6B, 0xA5C4, 0x1F6C, 0xA5C6, 0x1F6D, 0xA5C8, 0x1F6E, 0xA5CA, ++ 0x1F6F, 0xA5CC, 0x1F70, 0x25CE, 0x1F71, 0x93AC, 0x1F72, 0x25D0, ++ 0x1F73, 0x93AD, 0x1F74, 0x25D2, 0x1F75, 0x93AE, 0x1F76, 0x25D4, ++ 0x1F77, 0x93AF, 0x1F78, 0x25D6, 0x1F79, 0x93CC, 0x1F7A, 0x25D8, ++ 0x1F7B, 0x93CD, 0x1F7C, 0x25DA, 0x1F7D, 0x93CE, 0x1F80, 0xA5DC, ++ 0x1F81, 0xA5DE, 0x1F82, 0xA5E0, 0x1F83, 0xA5E2, 0x1F84, 0xA5E4, ++ 0x1F85, 0xA5E6, 0x1F86, 0xA5E8, 0x1F87, 0xA5EA, 0x1F88, 0xA5EC, ++ 0x1F89, 0xA5EE, 0x1F8A, 0xA5F0, 0x1F8B, 0xA5F2, 0x1F8C, 0xA5F4, ++ 0x1F8D, 0xA5F6, 0x1F8E, 0xA5F8, 0x1F8F, 0xA5FA, 0x1F90, 0xA5FC, ++ 0x1F91, 0xA5FE, 0x1F92, 0xA600, 0x1F93, 0xA602, 0x1F94, 0xA604, ++ 0x1F95, 0xA606, 0x1F96, 0xA608, 0x1F97, 0xA60A, 0x1F98, 0xA60C, ++ 0x1F99, 0xA60E, 0x1F9A, 0xA610, 0x1F9B, 0xA612, 0x1F9C, 0xA614, ++ 0x1F9D, 0xA616, 0x1F9E, 0xA618, 0x1F9F, 0xA61A, 0x1FA0, 0xA61C, ++ 0x1FA1, 0xA61E, 0x1FA2, 0xA620, 0x1FA3, 0xA622, 0x1FA4, 0xA624, ++ 0x1FA5, 0xA626, 0x1FA6, 0xA628, 0x1FA7, 0xA62A, 0x1FA8, 0xA62C, ++ 0x1FA9, 0xA62E, 0x1FAA, 0xA630, 0x1FAB, 0xA632, 0x1FAC, 0xA634, ++ 0x1FAD, 0xA636, 0x1FAE, 0xA638, 0x1FAF, 0xA63A, 0x1FB0, 0x263C, ++ 0x1FB1, 0x263E, 0x1FB2, 0xA640, 0x1FB3, 0x2642, 0x1FB4, 0xA644, ++ 0x1FB6, 0x2646, 0x1FB7, 0xA648, 0x1FB8, 0x264A, 0x1FB9, 0x264C, ++ 0x1FBA, 0x264E, 0x1FBB, 0x9386, 0x1FBC, 0x2650, 0x1FBE, 0x13B9, ++ 0x1FC1, 0x2652, 0x1FC2, 0xA654, 0x1FC3, 0x2656, 0x1FC4, 0xA658, ++ 0x1FC6, 0x265A, 0x1FC7, 0xA65C, 0x1FC8, 0x265E, 0x1FC9, 0x9388, ++ 0x1FCA, 0x2660, 0x1FCB, 0x9389, 0x1FCC, 0x2662, 0x1FCD, 0x2664, ++ 0x1FCE, 0x2666, 0x1FCF, 0x2668, 0x1FD0, 0x266A, 0x1FD1, 0x266C, ++ 0x1FD2, 0xA66E, 0x1FD3, 0x9390, 0x1FD6, 0x2670, 0x1FD7, 0xA672, ++ 0x1FD8, 0x2674, 0x1FD9, 0x2676, 0x1FDA, 0x2678, 0x1FDB, 0x938A, ++ 0x1FDD, 0x267A, 0x1FDE, 0x267C, 0x1FDF, 0x267E, 0x1FE0, 0x2680, ++ 0x1FE1, 0x2682, 0x1FE2, 0xA684, 0x1FE3, 0x93B0, 0x1FE4, 0x2686, ++ 0x1FE5, 0x2688, 0x1FE6, 0x268A, 0x1FE7, 0xA68C, 0x1FE8, 0x268E, ++ 0x1FE9, 0x2690, 0x1FEA, 0x2692, 0x1FEB, 0x938E, 0x1FEC, 0x2694, ++ 0x1FED, 0x2696, 0x1FEE, 0x9385, 0x1FEF, 0x1060, 0x1FF2, 0xA698, ++ 0x1FF3, 0x269A, 0x1FF4, 0xA69C, 0x1FF6, 0x269E, 0x1FF7, 0xA6A0, ++ 0x1FF8, 0x26A2, 0x1FF9, 0x938C, 0x1FFA, 0x26A4, 0x1FFB, 0x938F, ++ 0x1FFC, 0x26A6, 0x1FFD, 0x10B4, 0x304C, 0x26A8, 0x304E, 0x26AA, ++ 0x3050, 0x26AC, 0x3052, 0x26AE, 0x3054, 0x26B0, 0x3056, 0x26B2, ++ 0x3058, 0x26B4, 0x305A, 0x26B6, 0x305C, 0x26B8, 0x305E, 0x26BA, ++ 0x3060, 0x26BC, 0x3062, 0x26BE, 0x3065, 0x26C0, 0x3067, 0x26C2, ++ 0x3069, 0x26C4, 0x3070, 0x26C6, 0x3071, 0x26C8, 0x3073, 0x26CA, ++ 0x3074, 0x26CC, 0x3076, 0x26CE, 0x3077, 0x26D0, 0x3079, 0x26D2, ++ 0x307A, 0x26D4, 0x307C, 0x26D6, 0x307D, 0x26D8, 0x3094, 0x26DA, ++ 0x309E, 0x26DC, 0x30AC, 0x26DE, 0x30AE, 0x26E0, 0x30B0, 0x26E2, ++ 0x30B2, 0x26E4, 0x30B4, 0x26E6, 0x30B6, 0x26E8, 0x30B8, 0x26EA, ++ 0x30BA, 0x26EC, 0x30BC, 0x26EE, 0x30BE, 0x26F0, 0x30C0, 0x26F2, ++ 0x30C2, 0x26F4, 0x30C5, 0x26F6, 0x30C7, 0x26F8, 0x30C9, 0x26FA, ++ 0x30D0, 0x26FC, 0x30D1, 0x26FE, 0x30D3, 0x2700, 0x30D4, 0x2702, ++ 0x30D6, 0x2704, 0x30D7, 0x2706, 0x30D9, 0x2708, 0x30DA, 0x270A, ++ 0x30DC, 0x270C, 0x30DD, 0x270E, 0x30F4, 0x2710, 0x30F7, 0x2712, ++ 0x30F8, 0x2714, 0x30F9, 0x2716, 0x30FA, 0x2718, 0x30FE, 0x271A, ++ 0xFB1D, 0x271C, 0xFB1F, 0x271E, 0xFB2A, 0x2720, 0xFB2B, 0x2722, ++ 0xFB2C, 0xA724, 0xFB2D, 0xA726, 0xFB2E, 0x2728, 0xFB2F, 0x272A, ++ 0xFB30, 0x272C, 0xFB31, 0x272E, 0xFB32, 0x2730, 0xFB33, 0x2732, ++ 0xFB34, 0x2734, 0xFB35, 0x2736, 0xFB36, 0x2738, 0xFB38, 0x273A, ++ 0xFB39, 0x273C, 0xFB3A, 0x273E, 0xFB3B, 0x2740, 0xFB3C, 0x2742, ++ 0xFB3E, 0x2744, 0xFB40, 0x2746, 0xFB41, 0x2748, 0xFB43, 0x274A, ++ 0xFB44, 0x274C, 0xFB46, 0x274E, 0xFB47, 0x2750, 0xFB48, 0x2752, ++ 0xFB49, 0x2754, 0xFB4A, 0x2756, 0xFB4B, 0x2758, 0xFB4C, 0x275A, ++ 0xFB4D, 0x275C, 0xFB4E, 0x275E ++}; ++ ++static const u_int32_t __UniCharDecompositionTableLength = ++ (sizeof(__CFUniCharDecompositionTable) / (sizeof(u_int16_t) * 2)); ++ ++ ++static const u_int16_t ++__CFUniCharMultipleDecompositionTable[] = { ++ 0x0041, 0x0300, 0x0041, 0x0301, 0x0041, 0x0302, 0x0041, 0x0303, ++ 0x0041, 0x0308, 0x0041, 0x030A, 0x0043, 0x0327, 0x0045, 0x0300, ++ 0x0045, 0x0301, 0x0045, 0x0302, 0x0045, 0x0308, 0x0049, 0x0300, ++ 0x0049, 0x0301, 0x0049, 0x0302, 0x0049, 0x0308, 0x004E, 0x0303, ++ 0x004F, 0x0300, 0x004F, 0x0301, 0x004F, 0x0302, 0x004F, 0x0303, ++ 0x004F, 0x0308, 0x0055, 0x0300, 0x0055, 0x0301, 0x0055, 0x0302, ++ 0x0055, 0x0308, 0x0059, 0x0301, 0x0061, 0x0300, 0x0061, 0x0301, ++ 0x0061, 0x0302, 0x0061, 0x0303, 0x0061, 0x0308, 0x0061, 0x030A, ++ 0x0063, 0x0327, 0x0065, 0x0300, 0x0065, 0x0301, 0x0065, 0x0302, ++ 0x0065, 0x0308, 0x0069, 0x0300, 0x0069, 0x0301, 0x0069, 0x0302, ++ 0x0069, 0x0308, 0x006E, 0x0303, 0x006F, 0x0300, 0x006F, 0x0301, ++ 0x006F, 0x0302, 0x006F, 0x0303, 0x006F, 0x0308, 0x0075, 0x0300, ++ 0x0075, 0x0301, 0x0075, 0x0302, 0x0075, 0x0308, 0x0079, 0x0301, ++ 0x0079, 0x0308, 0x0041, 0x0304, 0x0061, 0x0304, 0x0041, 0x0306, ++ 0x0061, 0x0306, 0x0041, 0x0328, 0x0061, 0x0328, 0x0043, 0x0301, ++ 0x0063, 0x0301, 0x0043, 0x0302, 0x0063, 0x0302, 0x0043, 0x0307, ++ 0x0063, 0x0307, 0x0043, 0x030C, 0x0063, 0x030C, 0x0044, 0x030C, ++ 0x0064, 0x030C, 0x0045, 0x0304, 0x0065, 0x0304, 0x0045, 0x0306, ++ 0x0065, 0x0306, 0x0045, 0x0307, 0x0065, 0x0307, 0x0045, 0x0328, ++ 0x0065, 0x0328, 0x0045, 0x030C, 0x0065, 0x030C, 0x0047, 0x0302, ++ 0x0067, 0x0302, 0x0047, 0x0306, 0x0067, 0x0306, 0x0047, 0x0307, ++ 0x0067, 0x0307, 0x0047, 0x0327, 0x0067, 0x0327, 0x0048, 0x0302, ++ 0x0068, 0x0302, 0x0049, 0x0303, 0x0069, 0x0303, 0x0049, 0x0304, ++ 0x0069, 0x0304, 0x0049, 0x0306, 0x0069, 0x0306, 0x0049, 0x0328, ++ 0x0069, 0x0328, 0x0049, 0x0307, 0x004A, 0x0302, 0x006A, 0x0302, ++ 0x004B, 0x0327, 0x006B, 0x0327, 0x004C, 0x0301, 0x006C, 0x0301, ++ 0x004C, 0x0327, 0x006C, 0x0327, 0x004C, 0x030C, 0x006C, 0x030C, ++ 0x004E, 0x0301, 0x006E, 0x0301, 0x004E, 0x0327, 0x006E, 0x0327, ++ 0x004E, 0x030C, 0x006E, 0x030C, 0x004F, 0x0304, 0x006F, 0x0304, ++ 0x004F, 0x0306, 0x006F, 0x0306, 0x004F, 0x030B, 0x006F, 0x030B, ++ 0x0052, 0x0301, 0x0072, 0x0301, 0x0052, 0x0327, 0x0072, 0x0327, ++ 0x0052, 0x030C, 0x0072, 0x030C, 0x0053, 0x0301, 0x0073, 0x0301, ++ 0x0053, 0x0302, 0x0073, 0x0302, 0x0053, 0x0327, 0x0073, 0x0327, ++ 0x0053, 0x030C, 0x0073, 0x030C, 0x0054, 0x0327, 0x0074, 0x0327, ++ 0x0054, 0x030C, 0x0074, 0x030C, 0x0055, 0x0303, 0x0075, 0x0303, ++ 0x0055, 0x0304, 0x0075, 0x0304, 0x0055, 0x0306, 0x0075, 0x0306, ++ 0x0055, 0x030A, 0x0075, 0x030A, 0x0055, 0x030B, 0x0075, 0x030B, ++ 0x0055, 0x0328, 0x0075, 0x0328, 0x0057, 0x0302, 0x0077, 0x0302, ++ 0x0059, 0x0302, 0x0079, 0x0302, 0x0059, 0x0308, 0x005A, 0x0301, ++ 0x007A, 0x0301, 0x005A, 0x0307, 0x007A, 0x0307, 0x005A, 0x030C, ++ 0x007A, 0x030C, 0x004F, 0x031B, 0x006F, 0x031B, 0x0055, 0x031B, ++ 0x0075, 0x031B, 0x0041, 0x030C, 0x0061, 0x030C, 0x0049, 0x030C, ++ 0x0069, 0x030C, 0x004F, 0x030C, 0x006F, 0x030C, 0x0055, 0x030C, ++ 0x0075, 0x030C, 0x00DC, 0x0304, 0x00FC, 0x0304, 0x00DC, 0x0301, ++ 0x00FC, 0x0301, 0x00DC, 0x030C, 0x00FC, 0x030C, 0x00DC, 0x0300, ++ 0x00FC, 0x0300, 0x00C4, 0x0304, 0x00E4, 0x0304, 0x0226, 0x0304, ++ 0x0227, 0x0304, 0x00C6, 0x0304, 0x00E6, 0x0304, 0x0047, 0x030C, ++ 0x0067, 0x030C, 0x004B, 0x030C, 0x006B, 0x030C, 0x004F, 0x0328, ++ 0x006F, 0x0328, 0x01EA, 0x0304, 0x01EB, 0x0304, 0x01B7, 0x030C, ++ 0x0292, 0x030C, 0x006A, 0x030C, 0x0047, 0x0301, 0x0067, 0x0301, ++ 0x004E, 0x0300, 0x006E, 0x0300, 0x00C5, 0x0301, 0x00E5, 0x0301, ++ 0x00C6, 0x0301, 0x00E6, 0x0301, 0x00D8, 0x0301, 0x00F8, 0x0301, ++ 0x0041, 0x030F, 0x0061, 0x030F, 0x0041, 0x0311, 0x0061, 0x0311, ++ 0x0045, 0x030F, 0x0065, 0x030F, 0x0045, 0x0311, 0x0065, 0x0311, ++ 0x0049, 0x030F, 0x0069, 0x030F, 0x0049, 0x0311, 0x0069, 0x0311, ++ 0x004F, 0x030F, 0x006F, 0x030F, 0x004F, 0x0311, 0x006F, 0x0311, ++ 0x0052, 0x030F, 0x0072, 0x030F, 0x0052, 0x0311, 0x0072, 0x0311, ++ 0x0055, 0x030F, 0x0075, 0x030F, 0x0055, 0x0311, 0x0075, 0x0311, ++ 0x0053, 0x0326, 0x0073, 0x0326, 0x0054, 0x0326, 0x0074, 0x0326, ++ 0x0048, 0x030C, 0x0068, 0x030C, 0x0041, 0x0307, 0x0061, 0x0307, ++ 0x0045, 0x0327, 0x0065, 0x0327, 0x00D6, 0x0304, 0x00F6, 0x0304, ++ 0x00D5, 0x0304, 0x00F5, 0x0304, 0x004F, 0x0307, 0x006F, 0x0307, ++ 0x022E, 0x0304, 0x022F, 0x0304, 0x0059, 0x0304, 0x0079, 0x0304, ++ 0x0308, 0x0301, 0x00A8, 0x0301, 0x0391, 0x0301, 0x0395, 0x0301, ++ 0x0397, 0x0301, 0x0399, 0x0301, 0x039F, 0x0301, 0x03A5, 0x0301, ++ 0x03A9, 0x0301, 0x03CA, 0x0301, 0x0399, 0x0308, 0x03A5, 0x0308, ++ 0x03B1, 0x0301, 0x03B5, 0x0301, 0x03B7, 0x0301, 0x03B9, 0x0301, ++ 0x03CB, 0x0301, 0x03B9, 0x0308, 0x03C5, 0x0308, 0x03BF, 0x0301, ++ 0x03C5, 0x0301, 0x03C9, 0x0301, 0x03D2, 0x0301, 0x03D2, 0x0308, ++ 0x0415, 0x0300, 0x0415, 0x0308, 0x0413, 0x0301, 0x0406, 0x0308, ++ 0x041A, 0x0301, 0x0418, 0x0300, 0x0423, 0x0306, 0x0418, 0x0306, ++ 0x0438, 0x0306, 0x0435, 0x0300, 0x0435, 0x0308, 0x0433, 0x0301, ++ 0x0456, 0x0308, 0x043A, 0x0301, 0x0438, 0x0300, 0x0443, 0x0306, ++ 0x0474, 0x030F, 0x0475, 0x030F, 0x0416, 0x0306, 0x0436, 0x0306, ++ 0x0410, 0x0306, 0x0430, 0x0306, 0x0410, 0x0308, 0x0430, 0x0308, ++ 0x0415, 0x0306, 0x0435, 0x0306, 0x04D8, 0x0308, 0x04D9, 0x0308, ++ 0x0416, 0x0308, 0x0436, 0x0308, 0x0417, 0x0308, 0x0437, 0x0308, ++ 0x0418, 0x0304, 0x0438, 0x0304, 0x0418, 0x0308, 0x0438, 0x0308, ++ 0x041E, 0x0308, 0x043E, 0x0308, 0x04E8, 0x0308, 0x04E9, 0x0308, ++ 0x042D, 0x0308, 0x044D, 0x0308, 0x0423, 0x0304, 0x0443, 0x0304, ++ 0x0423, 0x0308, 0x0443, 0x0308, 0x0423, 0x030B, 0x0443, 0x030B, ++ 0x0427, 0x0308, 0x0447, 0x0308, 0x042B, 0x0308, 0x044B, 0x0308, ++ 0x0627, 0x0653, 0x0627, 0x0654, 0x0648, 0x0654, 0x0627, 0x0655, ++ 0x064A, 0x0654, 0x06D5, 0x0654, 0x06C1, 0x0654, 0x06D2, 0x0654, ++ 0x0928, 0x093C, 0x0930, 0x093C, 0x0933, 0x093C, 0x0915, 0x093C, ++ 0x0916, 0x093C, 0x0917, 0x093C, 0x091C, 0x093C, 0x0921, 0x093C, ++ 0x0922, 0x093C, 0x092B, 0x093C, 0x092F, 0x093C, 0x09C7, 0x09BE, ++ 0x09C7, 0x09D7, 0x09A1, 0x09BC, 0x09A2, 0x09BC, 0x09AF, 0x09BC, ++ 0x0A32, 0x0A3C, 0x0A38, 0x0A3C, 0x0A16, 0x0A3C, 0x0A17, 0x0A3C, ++ 0x0A1C, 0x0A3C, 0x0A2B, 0x0A3C, 0x0B47, 0x0B56, 0x0B47, 0x0B3E, ++ 0x0B47, 0x0B57, 0x0B21, 0x0B3C, 0x0B22, 0x0B3C, 0x0B92, 0x0BD7, ++ 0x0BC6, 0x0BBE, 0x0BC7, 0x0BBE, 0x0BC6, 0x0BD7, 0x0C46, 0x0C56, ++ 0x0CBF, 0x0CD5, 0x0CC6, 0x0CD5, 0x0CC6, 0x0CD6, 0x0CC6, 0x0CC2, ++ 0x0CCA, 0x0CD5, 0x0D46, 0x0D3E, 0x0D47, 0x0D3E, 0x0D46, 0x0D57, ++ 0x0DD9, 0x0DCA, 0x0DD9, 0x0DCF, 0x0DDC, 0x0DCA, 0x0DD9, 0x0DDF, ++ 0x0F42, 0x0FB7, 0x0F4C, 0x0FB7, 0x0F51, 0x0FB7, 0x0F56, 0x0FB7, ++ 0x0F5B, 0x0FB7, 0x0F40, 0x0FB5, 0x0F71, 0x0F72, 0x0F71, 0x0F74, ++ 0x0FB2, 0x0F80, 0x0FB3, 0x0F80, 0x0F71, 0x0F80, 0x0F92, 0x0FB7, ++ 0x0F9C, 0x0FB7, 0x0FA1, 0x0FB7, 0x0FA6, 0x0FB7, 0x0FAB, 0x0FB7, ++ 0x0F90, 0x0FB5, 0x1025, 0x102E, 0x0041, 0x0325, 0x0061, 0x0325, ++ 0x0042, 0x0307, 0x0062, 0x0307, 0x0042, 0x0323, 0x0062, 0x0323, ++ 0x0042, 0x0331, 0x0062, 0x0331, 0x00C7, 0x0301, 0x00E7, 0x0301, ++ 0x0044, 0x0307, 0x0064, 0x0307, 0x0044, 0x0323, 0x0064, 0x0323, ++ 0x0044, 0x0331, 0x0064, 0x0331, 0x0044, 0x0327, 0x0064, 0x0327, ++ 0x0044, 0x032D, 0x0064, 0x032D, 0x0112, 0x0300, 0x0113, 0x0300, ++ 0x0112, 0x0301, 0x0113, 0x0301, 0x0045, 0x032D, 0x0065, 0x032D, ++ 0x0045, 0x0330, 0x0065, 0x0330, 0x0228, 0x0306, 0x0229, 0x0306, ++ 0x0046, 0x0307, 0x0066, 0x0307, 0x0047, 0x0304, 0x0067, 0x0304, ++ 0x0048, 0x0307, 0x0068, 0x0307, 0x0048, 0x0323, 0x0068, 0x0323, ++ 0x0048, 0x0308, 0x0068, 0x0308, 0x0048, 0x0327, 0x0068, 0x0327, ++ 0x0048, 0x032E, 0x0068, 0x032E, 0x0049, 0x0330, 0x0069, 0x0330, ++ 0x00CF, 0x0301, 0x00EF, 0x0301, 0x004B, 0x0301, 0x006B, 0x0301, ++ 0x004B, 0x0323, 0x006B, 0x0323, 0x004B, 0x0331, 0x006B, 0x0331, ++ 0x004C, 0x0323, 0x006C, 0x0323, 0x1E36, 0x0304, 0x1E37, 0x0304, ++ 0x004C, 0x0331, 0x006C, 0x0331, 0x004C, 0x032D, 0x006C, 0x032D, ++ 0x004D, 0x0301, 0x006D, 0x0301, 0x004D, 0x0307, 0x006D, 0x0307, ++ 0x004D, 0x0323, 0x006D, 0x0323, 0x004E, 0x0307, 0x006E, 0x0307, ++ 0x004E, 0x0323, 0x006E, 0x0323, 0x004E, 0x0331, 0x006E, 0x0331, ++ 0x004E, 0x032D, 0x006E, 0x032D, 0x00D5, 0x0301, 0x00F5, 0x0301, ++ 0x00D5, 0x0308, 0x00F5, 0x0308, 0x014C, 0x0300, 0x014D, 0x0300, ++ 0x014C, 0x0301, 0x014D, 0x0301, 0x0050, 0x0301, 0x0070, 0x0301, ++ 0x0050, 0x0307, 0x0070, 0x0307, 0x0052, 0x0307, 0x0072, 0x0307, ++ 0x0052, 0x0323, 0x0072, 0x0323, 0x1E5A, 0x0304, 0x1E5B, 0x0304, ++ 0x0052, 0x0331, 0x0072, 0x0331, 0x0053, 0x0307, 0x0073, 0x0307, ++ 0x0053, 0x0323, 0x0073, 0x0323, 0x015A, 0x0307, 0x015B, 0x0307, ++ 0x0160, 0x0307, 0x0161, 0x0307, 0x1E62, 0x0307, 0x1E63, 0x0307, ++ 0x0054, 0x0307, 0x0074, 0x0307, 0x0054, 0x0323, 0x0074, 0x0323, ++ 0x0054, 0x0331, 0x0074, 0x0331, 0x0054, 0x032D, 0x0074, 0x032D, ++ 0x0055, 0x0324, 0x0075, 0x0324, 0x0055, 0x0330, 0x0075, 0x0330, ++ 0x0055, 0x032D, 0x0075, 0x032D, 0x0168, 0x0301, 0x0169, 0x0301, ++ 0x016A, 0x0308, 0x016B, 0x0308, 0x0056, 0x0303, 0x0076, 0x0303, ++ 0x0056, 0x0323, 0x0076, 0x0323, 0x0057, 0x0300, 0x0077, 0x0300, ++ 0x0057, 0x0301, 0x0077, 0x0301, 0x0057, 0x0308, 0x0077, 0x0308, ++ 0x0057, 0x0307, 0x0077, 0x0307, 0x0057, 0x0323, 0x0077, 0x0323, ++ 0x0058, 0x0307, 0x0078, 0x0307, 0x0058, 0x0308, 0x0078, 0x0308, ++ 0x0059, 0x0307, 0x0079, 0x0307, 0x005A, 0x0302, 0x007A, 0x0302, ++ 0x005A, 0x0323, 0x007A, 0x0323, 0x005A, 0x0331, 0x007A, 0x0331, ++ 0x0068, 0x0331, 0x0074, 0x0308, 0x0077, 0x030A, 0x0079, 0x030A, ++ 0x017F, 0x0307, 0x0041, 0x0323, 0x0061, 0x0323, 0x0041, 0x0309, ++ 0x0061, 0x0309, 0x00C2, 0x0301, 0x00E2, 0x0301, 0x00C2, 0x0300, ++ 0x00E2, 0x0300, 0x00C2, 0x0309, 0x00E2, 0x0309, 0x00C2, 0x0303, ++ 0x00E2, 0x0303, 0x1EA0, 0x0302, 0x1EA1, 0x0302, 0x0102, 0x0301, ++ 0x0103, 0x0301, 0x0102, 0x0300, 0x0103, 0x0300, 0x0102, 0x0309, ++ 0x0103, 0x0309, 0x0102, 0x0303, 0x0103, 0x0303, 0x1EA0, 0x0306, ++ 0x1EA1, 0x0306, 0x0045, 0x0323, 0x0065, 0x0323, 0x0045, 0x0309, ++ 0x0065, 0x0309, 0x0045, 0x0303, 0x0065, 0x0303, 0x00CA, 0x0301, ++ 0x00EA, 0x0301, 0x00CA, 0x0300, 0x00EA, 0x0300, 0x00CA, 0x0309, ++ 0x00EA, 0x0309, 0x00CA, 0x0303, 0x00EA, 0x0303, 0x1EB8, 0x0302, ++ 0x1EB9, 0x0302, 0x0049, 0x0309, 0x0069, 0x0309, 0x0049, 0x0323, ++ 0x0069, 0x0323, 0x004F, 0x0323, 0x006F, 0x0323, 0x004F, 0x0309, ++ 0x006F, 0x0309, 0x00D4, 0x0301, 0x00F4, 0x0301, 0x00D4, 0x0300, ++ 0x00F4, 0x0300, 0x00D4, 0x0309, 0x00F4, 0x0309, 0x00D4, 0x0303, ++ 0x00F4, 0x0303, 0x1ECC, 0x0302, 0x1ECD, 0x0302, 0x01A0, 0x0301, ++ 0x01A1, 0x0301, 0x01A0, 0x0300, 0x01A1, 0x0300, 0x01A0, 0x0309, ++ 0x01A1, 0x0309, 0x01A0, 0x0303, 0x01A1, 0x0303, 0x01A0, 0x0323, ++ 0x01A1, 0x0323, 0x0055, 0x0323, 0x0075, 0x0323, 0x0055, 0x0309, ++ 0x0075, 0x0309, 0x01AF, 0x0301, 0x01B0, 0x0301, 0x01AF, 0x0300, ++ 0x01B0, 0x0300, 0x01AF, 0x0309, 0x01B0, 0x0309, 0x01AF, 0x0303, ++ 0x01B0, 0x0303, 0x01AF, 0x0323, 0x01B0, 0x0323, 0x0059, 0x0300, ++ 0x0079, 0x0300, 0x0059, 0x0323, 0x0079, 0x0323, 0x0059, 0x0309, ++ 0x0079, 0x0309, 0x0059, 0x0303, 0x0079, 0x0303, 0x03B1, 0x0313, ++ 0x03B1, 0x0314, 0x1F00, 0x0300, 0x1F01, 0x0300, 0x1F00, 0x0301, ++ 0x1F01, 0x0301, 0x1F00, 0x0342, 0x1F01, 0x0342, 0x0391, 0x0313, ++ 0x0391, 0x0314, 0x1F08, 0x0300, 0x1F09, 0x0300, 0x1F08, 0x0301, ++ 0x1F09, 0x0301, 0x1F08, 0x0342, 0x1F09, 0x0342, 0x03B5, 0x0313, ++ 0x03B5, 0x0314, 0x1F10, 0x0300, 0x1F11, 0x0300, 0x1F10, 0x0301, ++ 0x1F11, 0x0301, 0x0395, 0x0313, 0x0395, 0x0314, 0x1F18, 0x0300, ++ 0x1F19, 0x0300, 0x1F18, 0x0301, 0x1F19, 0x0301, 0x03B7, 0x0313, ++ 0x03B7, 0x0314, 0x1F20, 0x0300, 0x1F21, 0x0300, 0x1F20, 0x0301, ++ 0x1F21, 0x0301, 0x1F20, 0x0342, 0x1F21, 0x0342, 0x0397, 0x0313, ++ 0x0397, 0x0314, 0x1F28, 0x0300, 0x1F29, 0x0300, 0x1F28, 0x0301, ++ 0x1F29, 0x0301, 0x1F28, 0x0342, 0x1F29, 0x0342, 0x03B9, 0x0313, ++ 0x03B9, 0x0314, 0x1F30, 0x0300, 0x1F31, 0x0300, 0x1F30, 0x0301, ++ 0x1F31, 0x0301, 0x1F30, 0x0342, 0x1F31, 0x0342, 0x0399, 0x0313, ++ 0x0399, 0x0314, 0x1F38, 0x0300, 0x1F39, 0x0300, 0x1F38, 0x0301, ++ 0x1F39, 0x0301, 0x1F38, 0x0342, 0x1F39, 0x0342, 0x03BF, 0x0313, ++ 0x03BF, 0x0314, 0x1F40, 0x0300, 0x1F41, 0x0300, 0x1F40, 0x0301, ++ 0x1F41, 0x0301, 0x039F, 0x0313, 0x039F, 0x0314, 0x1F48, 0x0300, ++ 0x1F49, 0x0300, 0x1F48, 0x0301, 0x1F49, 0x0301, 0x03C5, 0x0313, ++ 0x03C5, 0x0314, 0x1F50, 0x0300, 0x1F51, 0x0300, 0x1F50, 0x0301, ++ 0x1F51, 0x0301, 0x1F50, 0x0342, 0x1F51, 0x0342, 0x03A5, 0x0314, ++ 0x1F59, 0x0300, 0x1F59, 0x0301, 0x1F59, 0x0342, 0x03C9, 0x0313, ++ 0x03C9, 0x0314, 0x1F60, 0x0300, 0x1F61, 0x0300, 0x1F60, 0x0301, ++ 0x1F61, 0x0301, 0x1F60, 0x0342, 0x1F61, 0x0342, 0x03A9, 0x0313, ++ 0x03A9, 0x0314, 0x1F68, 0x0300, 0x1F69, 0x0300, 0x1F68, 0x0301, ++ 0x1F69, 0x0301, 0x1F68, 0x0342, 0x1F69, 0x0342, 0x03B1, 0x0300, ++ 0x03B5, 0x0300, 0x03B7, 0x0300, 0x03B9, 0x0300, 0x03BF, 0x0300, ++ 0x03C5, 0x0300, 0x03C9, 0x0300, 0x1F00, 0x0345, 0x1F01, 0x0345, ++ 0x1F02, 0x0345, 0x1F03, 0x0345, 0x1F04, 0x0345, 0x1F05, 0x0345, ++ 0x1F06, 0x0345, 0x1F07, 0x0345, 0x1F08, 0x0345, 0x1F09, 0x0345, ++ 0x1F0A, 0x0345, 0x1F0B, 0x0345, 0x1F0C, 0x0345, 0x1F0D, 0x0345, ++ 0x1F0E, 0x0345, 0x1F0F, 0x0345, 0x1F20, 0x0345, 0x1F21, 0x0345, ++ 0x1F22, 0x0345, 0x1F23, 0x0345, 0x1F24, 0x0345, 0x1F25, 0x0345, ++ 0x1F26, 0x0345, 0x1F27, 0x0345, 0x1F28, 0x0345, 0x1F29, 0x0345, ++ 0x1F2A, 0x0345, 0x1F2B, 0x0345, 0x1F2C, 0x0345, 0x1F2D, 0x0345, ++ 0x1F2E, 0x0345, 0x1F2F, 0x0345, 0x1F60, 0x0345, 0x1F61, 0x0345, ++ 0x1F62, 0x0345, 0x1F63, 0x0345, 0x1F64, 0x0345, 0x1F65, 0x0345, ++ 0x1F66, 0x0345, 0x1F67, 0x0345, 0x1F68, 0x0345, 0x1F69, 0x0345, ++ 0x1F6A, 0x0345, 0x1F6B, 0x0345, 0x1F6C, 0x0345, 0x1F6D, 0x0345, ++ 0x1F6E, 0x0345, 0x1F6F, 0x0345, 0x03B1, 0x0306, 0x03B1, 0x0304, ++ 0x1F70, 0x0345, 0x03B1, 0x0345, 0x03AC, 0x0345, 0x03B1, 0x0342, ++ 0x1FB6, 0x0345, 0x0391, 0x0306, 0x0391, 0x0304, 0x0391, 0x0300, ++ 0x0391, 0x0345, 0x00A8, 0x0342, 0x1F74, 0x0345, 0x03B7, 0x0345, ++ 0x03AE, 0x0345, 0x03B7, 0x0342, 0x1FC6, 0x0345, 0x0395, 0x0300, ++ 0x0397, 0x0300, 0x0397, 0x0345, 0x1FBF, 0x0300, 0x1FBF, 0x0301, ++ 0x1FBF, 0x0342, 0x03B9, 0x0306, 0x03B9, 0x0304, 0x03CA, 0x0300, ++ 0x03B9, 0x0342, 0x03CA, 0x0342, 0x0399, 0x0306, 0x0399, 0x0304, ++ 0x0399, 0x0300, 0x1FFE, 0x0300, 0x1FFE, 0x0301, 0x1FFE, 0x0342, ++ 0x03C5, 0x0306, 0x03C5, 0x0304, 0x03CB, 0x0300, 0x03C1, 0x0313, ++ 0x03C1, 0x0314, 0x03C5, 0x0342, 0x03CB, 0x0342, 0x03A5, 0x0306, ++ 0x03A5, 0x0304, 0x03A5, 0x0300, 0x03A1, 0x0314, 0x00A8, 0x0300, ++ 0x1F7C, 0x0345, 0x03C9, 0x0345, 0x03CE, 0x0345, 0x03C9, 0x0342, ++ 0x1FF6, 0x0345, 0x039F, 0x0300, 0x03A9, 0x0300, 0x03A9, 0x0345, ++ 0x304B, 0x3099, 0x304D, 0x3099, 0x304F, 0x3099, 0x3051, 0x3099, ++ 0x3053, 0x3099, 0x3055, 0x3099, 0x3057, 0x3099, 0x3059, 0x3099, ++ 0x305B, 0x3099, 0x305D, 0x3099, 0x305F, 0x3099, 0x3061, 0x3099, ++ 0x3064, 0x3099, 0x3066, 0x3099, 0x3068, 0x3099, 0x306F, 0x3099, ++ 0x306F, 0x309A, 0x3072, 0x3099, 0x3072, 0x309A, 0x3075, 0x3099, ++ 0x3075, 0x309A, 0x3078, 0x3099, 0x3078, 0x309A, 0x307B, 0x3099, ++ 0x307B, 0x309A, 0x3046, 0x3099, 0x309D, 0x3099, 0x30AB, 0x3099, ++ 0x30AD, 0x3099, 0x30AF, 0x3099, 0x30B1, 0x3099, 0x30B3, 0x3099, ++ 0x30B5, 0x3099, 0x30B7, 0x3099, 0x30B9, 0x3099, 0x30BB, 0x3099, ++ 0x30BD, 0x3099, 0x30BF, 0x3099, 0x30C1, 0x3099, 0x30C4, 0x3099, ++ 0x30C6, 0x3099, 0x30C8, 0x3099, 0x30CF, 0x3099, 0x30CF, 0x309A, ++ 0x30D2, 0x3099, 0x30D2, 0x309A, 0x30D5, 0x3099, 0x30D5, 0x309A, ++ 0x30D8, 0x3099, 0x30D8, 0x309A, 0x30DB, 0x3099, 0x30DB, 0x309A, ++ 0x30A6, 0x3099, 0x30EF, 0x3099, 0x30F0, 0x3099, 0x30F1, 0x3099, ++ 0x30F2, 0x3099, 0x30FD, 0x3099, 0x05D9, 0x05B4, 0x05F2, 0x05B7, ++ 0x05E9, 0x05C1, 0x05E9, 0x05C2, 0xFB49, 0x05C1, 0xFB49, 0x05C2, ++ 0x05D0, 0x05B7, 0x05D0, 0x05B8, 0x05D0, 0x05BC, 0x05D1, 0x05BC, ++ 0x05D2, 0x05BC, 0x05D3, 0x05BC, 0x05D4, 0x05BC, 0x05D5, 0x05BC, ++ 0x05D6, 0x05BC, 0x05D8, 0x05BC, 0x05D9, 0x05BC, 0x05DA, 0x05BC, ++ 0x05DB, 0x05BC, 0x05DC, 0x05BC, 0x05DE, 0x05BC, 0x05E0, 0x05BC, ++ 0x05E1, 0x05BC, 0x05E3, 0x05BC, 0x05E4, 0x05BC, 0x05E6, 0x05BC, ++ 0x05E7, 0x05BC, 0x05E8, 0x05BC, 0x05E9, 0x05BC, 0x05EA, 0x05BC, ++ 0x05D5, 0x05B9, 0x05D1, 0x05BF, 0x05DB, 0x05BF, 0x05E4, 0x05BF ++}; ++ ++static const u_int8_t ++__CFUniCharDecomposableBitmap[] = { ++ 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x06, 0x00, ++ 0x00, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x00, 0x0C, ++ 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0F, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x11, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, ++ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0xBF, 0xFF, 0x7E, 0x3E, 0xBF, 0xFF, 0x7E, 0xBE, ++ 0xFF, 0xFF, 0xFC, 0xFF, 0x3F, 0xFF, 0xF1, 0x7E, ++ 0xF8, 0xF1, 0xF3, 0xFF, 0x3F, 0xFF, 0xFF, 0x7F, ++ 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x01, 0x00, ++ 0x00, 0xE0, 0xFF, 0xDF, 0xCF, 0xFF, 0x31, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xCF, 0xC0, 0xFF, 0x0F, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, ++ 0xE0, 0xD7, 0x01, 0x00, 0x00, 0xFC, 0x01, 0x00, ++ 0x00, 0x7C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x8B, 0x70, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, ++ 0x00, 0x00, 0x8B, 0x70, 0x00, 0x00, 0xC0, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x06, 0x00, 0xCF, 0xFC, 0xFC, 0xFC, 0x3F, 0x03, ++ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x12, 0x00, ++ 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x18, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, ++ 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x19, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x81, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x08, 0x20, 0x84, 0x10, 0x00, 0x02, 0x68, 0x01, ++ 0x02, 0x00, 0x08, 0x20, 0x84, 0x10, 0x00, 0x02, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, ++ 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0x3F, 0x3F, 0xFF, 0xAA, 0xFF, 0xFF, 0xFF, 0x3F, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x5F, ++ 0xDE, 0xFF, 0xCF, 0xEF, 0xFF, 0xFF, 0xDC, 0x3F, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x50, 0x55, 0x55, 0xA5, 0x02, 0xDB, 0x36, ++ 0x00, 0x00, 0x10, 0x40, 0x00, 0x50, 0x55, 0x55, ++ 0xA5, 0x02, 0xDB, 0x36, 0x00, 0x00, 0x90, 0x47, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0xA0, 0x00, 0xFC, 0x7F, 0x5F, ++ 0xDB, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ++}; ++ ++static const u_int32_t ++__CFUniCharPrecompSourceTable[] = { ++ 0x00000300, 0x00540000, 0x00000301, 0x00750054, ++ 0x00000302, 0x002000C9, 0x00000303, 0x001C00E9, ++ 0x00000304, 0x002C0105, 0x00000306, 0x00200131, ++ 0x00000307, 0x002E0151, 0x00000308, 0x0036017F, ++ 0x00000309, 0x001801B5, 0x0000030A, 0x000601CD, ++ 0x0000030B, 0x000601D3, 0x0000030C, 0x002501D9, ++ 0x0000030F, 0x000E01FE, 0x00000311, 0x000C020C, ++ 0x00000313, 0x000E0218, 0x00000314, 0x00100226, ++ 0x0000031B, 0x00040236, 0x00000323, 0x002A023A, ++ 0x00000324, 0x00020264, 0x00000325, 0x00020266, ++ 0x00000326, 0x00040268, 0x00000327, 0x0016026C, ++ 0x00000328, 0x000A0282, 0x0000032D, 0x000C028C, ++ 0x0000032E, 0x00020298, 0x00000330, 0x0006029A, ++ 0x00000331, 0x001102A0, 0x00000338, 0x002C02B1, ++ 0x00000342, 0x001D02DD, 0x00000345, 0x003F02FA, ++ 0x00000653, 0x00010339, 0x00000654, 0x0006033A, ++ 0x00000655, 0x00010340, 0x0000093C, 0x00030341, ++ 0x000009BE, 0x00010344, 0x000009D7, 0x00010345, ++ 0x00000B3E, 0x00010346, 0x00000B56, 0x00010347, ++ 0x00000B57, 0x00010348, 0x00000BBE, 0x00020349, ++ 0x00000BD7, 0x0002034B, 0x00000C56, 0x0001034D, ++ 0x00000CC2, 0x0001034E, 0x00000CD5, 0x0003034F, ++ 0x00000CD6, 0x00010352, 0x00000D3E, 0x00020353, ++ 0x00000D57, 0x00010355, 0x00000DCA, 0x00020356, ++ 0x00000DCF, 0x00010358, 0x00000DDF, 0x00010359, ++ 0x0000102E, 0x0001035A, 0x00003099, 0x0030035B, ++ 0x0000309A, 0x000A038B ++}; ++ ++static const u_int32_t __CFUniCharPrecompositionTableLength = ++ (sizeof(__CFUniCharPrecompSourceTable) / (sizeof(u_int32_t) * 2)); ++ ++ ++static const u_int16_t ++__CFUniCharBMPPrecompDestinationTable[] = { ++ 0x0041, 0x00C0, 0x0045, 0x00C8, 0x0049, 0x00CC, 0x004E, 0x01F8, ++ 0x004F, 0x00D2, 0x0055, 0x00D9, 0x0057, 0x1E80, 0x0059, 0x1EF2, ++ 0x0061, 0x00E0, 0x0065, 0x00E8, 0x0069, 0x00EC, 0x006E, 0x01F9, ++ 0x006F, 0x00F2, 0x0075, 0x00F9, 0x0077, 0x1E81, 0x0079, 0x1EF3, ++ 0x00A8, 0x1FED, 0x00C2, 0x1EA6, 0x00CA, 0x1EC0, 0x00D4, 0x1ED2, ++ 0x00DC, 0x01DB, 0x00E2, 0x1EA7, 0x00EA, 0x1EC1, 0x00F4, 0x1ED3, ++ 0x00FC, 0x01DC, 0x0102, 0x1EB0, 0x0103, 0x1EB1, 0x0112, 0x1E14, ++ 0x0113, 0x1E15, 0x014C, 0x1E50, 0x014D, 0x1E51, 0x01A0, 0x1EDC, ++ 0x01A1, 0x1EDD, 0x01AF, 0x1EEA, 0x01B0, 0x1EEB, 0x0391, 0x1FBA, ++ 0x0395, 0x1FC8, 0x0397, 0x1FCA, 0x0399, 0x1FDA, 0x039F, 0x1FF8, ++ 0x03A5, 0x1FEA, 0x03A9, 0x1FFA, 0x03B1, 0x1F70, 0x03B5, 0x1F72, ++ 0x03B7, 0x1F74, 0x03B9, 0x1F76, 0x03BF, 0x1F78, 0x03C5, 0x1F7A, ++ 0x03C9, 0x1F7C, 0x03CA, 0x1FD2, 0x03CB, 0x1FE2, 0x0415, 0x0400, ++ 0x0418, 0x040D, 0x0435, 0x0450, 0x0438, 0x045D, 0x1F00, 0x1F02, ++ 0x1F01, 0x1F03, 0x1F08, 0x1F0A, 0x1F09, 0x1F0B, 0x1F10, 0x1F12, ++ 0x1F11, 0x1F13, 0x1F18, 0x1F1A, 0x1F19, 0x1F1B, 0x1F20, 0x1F22, ++ 0x1F21, 0x1F23, 0x1F28, 0x1F2A, 0x1F29, 0x1F2B, 0x1F30, 0x1F32, ++ 0x1F31, 0x1F33, 0x1F38, 0x1F3A, 0x1F39, 0x1F3B, 0x1F40, 0x1F42, ++ 0x1F41, 0x1F43, 0x1F48, 0x1F4A, 0x1F49, 0x1F4B, 0x1F50, 0x1F52, ++ 0x1F51, 0x1F53, 0x1F59, 0x1F5B, 0x1F60, 0x1F62, 0x1F61, 0x1F63, ++ 0x1F68, 0x1F6A, 0x1F69, 0x1F6B, 0x1FBF, 0x1FCD, 0x1FFE, 0x1FDD, ++ 0x0041, 0x00C1, 0x0043, 0x0106, 0x0045, 0x00C9, 0x0047, 0x01F4, ++ 0x0049, 0x00CD, 0x004B, 0x1E30, 0x004C, 0x0139, 0x004D, 0x1E3E, ++ 0x004E, 0x0143, 0x004F, 0x00D3, 0x0050, 0x1E54, 0x0052, 0x0154, ++ 0x0053, 0x015A, 0x0055, 0x00DA, 0x0057, 0x1E82, 0x0059, 0x00DD, ++ 0x005A, 0x0179, 0x0061, 0x00E1, 0x0063, 0x0107, 0x0065, 0x00E9, ++ 0x0067, 0x01F5, 0x0069, 0x00ED, 0x006B, 0x1E31, 0x006C, 0x013A, ++ 0x006D, 0x1E3F, 0x006E, 0x0144, 0x006F, 0x00F3, 0x0070, 0x1E55, ++ 0x0072, 0x0155, 0x0073, 0x015B, 0x0075, 0x00FA, 0x0077, 0x1E83, ++ 0x0079, 0x00FD, 0x007A, 0x017A, 0x00A8, 0x0385, 0x00C2, 0x1EA4, ++ 0x00C5, 0x01FA, 0x00C6, 0x01FC, 0x00C7, 0x1E08, 0x00CA, 0x1EBE, ++ 0x00CF, 0x1E2E, 0x00D4, 0x1ED0, 0x00D5, 0x1E4C, 0x00D8, 0x01FE, ++ 0x00DC, 0x01D7, 0x00E2, 0x1EA5, 0x00E5, 0x01FB, 0x00E6, 0x01FD, ++ 0x00E7, 0x1E09, 0x00EA, 0x1EBF, 0x00EF, 0x1E2F, 0x00F4, 0x1ED1, ++ 0x00F5, 0x1E4D, 0x00F8, 0x01FF, 0x00FC, 0x01D8, 0x0102, 0x1EAE, ++ 0x0103, 0x1EAF, 0x0112, 0x1E16, 0x0113, 0x1E17, 0x014C, 0x1E52, ++ 0x014D, 0x1E53, 0x0168, 0x1E78, 0x0169, 0x1E79, 0x01A0, 0x1EDA, ++ 0x01A1, 0x1EDB, 0x01AF, 0x1EE8, 0x01B0, 0x1EE9, 0x0391, 0x0386, ++ 0x0395, 0x0388, 0x0397, 0x0389, 0x0399, 0x038A, 0x039F, 0x038C, ++ 0x03A5, 0x038E, 0x03A9, 0x038F, 0x03B1, 0x03AC, 0x03B5, 0x03AD, ++ 0x03B7, 0x03AE, 0x03B9, 0x03AF, 0x03BF, 0x03CC, 0x03C5, 0x03CD, ++ 0x03C9, 0x03CE, 0x03CA, 0x0390, 0x03CB, 0x03B0, 0x03D2, 0x03D3, ++ 0x0413, 0x0403, 0x041A, 0x040C, 0x0433, 0x0453, 0x043A, 0x045C, ++ 0x1F00, 0x1F04, 0x1F01, 0x1F05, 0x1F08, 0x1F0C, 0x1F09, 0x1F0D, ++ 0x1F10, 0x1F14, 0x1F11, 0x1F15, 0x1F18, 0x1F1C, 0x1F19, 0x1F1D, ++ 0x1F20, 0x1F24, 0x1F21, 0x1F25, 0x1F28, 0x1F2C, 0x1F29, 0x1F2D, ++ 0x1F30, 0x1F34, 0x1F31, 0x1F35, 0x1F38, 0x1F3C, 0x1F39, 0x1F3D, ++ 0x1F40, 0x1F44, 0x1F41, 0x1F45, 0x1F48, 0x1F4C, 0x1F49, 0x1F4D, ++ 0x1F50, 0x1F54, 0x1F51, 0x1F55, 0x1F59, 0x1F5D, 0x1F60, 0x1F64, ++ 0x1F61, 0x1F65, 0x1F68, 0x1F6C, 0x1F69, 0x1F6D, 0x1FBF, 0x1FCE, ++ 0x1FFE, 0x1FDE, 0x0041, 0x00C2, 0x0043, 0x0108, 0x0045, 0x00CA, ++ 0x0047, 0x011C, 0x0048, 0x0124, 0x0049, 0x00CE, 0x004A, 0x0134, ++ 0x004F, 0x00D4, 0x0053, 0x015C, 0x0055, 0x00DB, 0x0057, 0x0174, ++ 0x0059, 0x0176, 0x005A, 0x1E90, 0x0061, 0x00E2, 0x0063, 0x0109, ++ 0x0065, 0x00EA, 0x0067, 0x011D, 0x0068, 0x0125, 0x0069, 0x00EE, ++ 0x006A, 0x0135, 0x006F, 0x00F4, 0x0073, 0x015D, 0x0075, 0x00FB, ++ 0x0077, 0x0175, 0x0079, 0x0177, 0x007A, 0x1E91, 0x1EA0, 0x1EAC, ++ 0x1EA1, 0x1EAD, 0x1EB8, 0x1EC6, 0x1EB9, 0x1EC7, 0x1ECC, 0x1ED8, ++ 0x1ECD, 0x1ED9, 0x0041, 0x00C3, 0x0045, 0x1EBC, 0x0049, 0x0128, ++ 0x004E, 0x00D1, 0x004F, 0x00D5, 0x0055, 0x0168, 0x0056, 0x1E7C, ++ 0x0059, 0x1EF8, 0x0061, 0x00E3, 0x0065, 0x1EBD, 0x0069, 0x0129, ++ 0x006E, 0x00F1, 0x006F, 0x00F5, 0x0075, 0x0169, 0x0076, 0x1E7D, ++ 0x0079, 0x1EF9, 0x00C2, 0x1EAA, 0x00CA, 0x1EC4, 0x00D4, 0x1ED6, ++ 0x00E2, 0x1EAB, 0x00EA, 0x1EC5, 0x00F4, 0x1ED7, 0x0102, 0x1EB4, ++ 0x0103, 0x1EB5, 0x01A0, 0x1EE0, 0x01A1, 0x1EE1, 0x01AF, 0x1EEE, ++ 0x01B0, 0x1EEF, 0x0041, 0x0100, 0x0045, 0x0112, 0x0047, 0x1E20, ++ 0x0049, 0x012A, 0x004F, 0x014C, 0x0055, 0x016A, 0x0059, 0x0232, ++ 0x0061, 0x0101, 0x0065, 0x0113, 0x0067, 0x1E21, 0x0069, 0x012B, ++ 0x006F, 0x014D, 0x0075, 0x016B, 0x0079, 0x0233, 0x00C4, 0x01DE, ++ 0x00C6, 0x01E2, 0x00D5, 0x022C, 0x00D6, 0x022A, 0x00DC, 0x01D5, ++ 0x00E4, 0x01DF, 0x00E6, 0x01E3, 0x00F5, 0x022D, 0x00F6, 0x022B, ++ 0x00FC, 0x01D6, 0x01EA, 0x01EC, 0x01EB, 0x01ED, 0x0226, 0x01E0, ++ 0x0227, 0x01E1, 0x022E, 0x0230, 0x022F, 0x0231, 0x0391, 0x1FB9, ++ 0x0399, 0x1FD9, 0x03A5, 0x1FE9, 0x03B1, 0x1FB1, 0x03B9, 0x1FD1, ++ 0x03C5, 0x1FE1, 0x0418, 0x04E2, 0x0423, 0x04EE, 0x0438, 0x04E3, ++ 0x0443, 0x04EF, 0x1E36, 0x1E38, 0x1E37, 0x1E39, 0x1E5A, 0x1E5C, ++ 0x1E5B, 0x1E5D, 0x0041, 0x0102, 0x0045, 0x0114, 0x0047, 0x011E, ++ 0x0049, 0x012C, 0x004F, 0x014E, 0x0055, 0x016C, 0x0061, 0x0103, ++ 0x0065, 0x0115, 0x0067, 0x011F, 0x0069, 0x012D, 0x006F, 0x014F, ++ 0x0075, 0x016D, 0x0228, 0x1E1C, 0x0229, 0x1E1D, 0x0391, 0x1FB8, ++ 0x0399, 0x1FD8, 0x03A5, 0x1FE8, 0x03B1, 0x1FB0, 0x03B9, 0x1FD0, ++ 0x03C5, 0x1FE0, 0x0410, 0x04D0, 0x0415, 0x04D6, 0x0416, 0x04C1, ++ 0x0418, 0x0419, 0x0423, 0x040E, 0x0430, 0x04D1, 0x0435, 0x04D7, ++ 0x0436, 0x04C2, 0x0438, 0x0439, 0x0443, 0x045E, 0x1EA0, 0x1EB6, ++ 0x1EA1, 0x1EB7, 0x0041, 0x0226, 0x0042, 0x1E02, 0x0043, 0x010A, ++ 0x0044, 0x1E0A, 0x0045, 0x0116, 0x0046, 0x1E1E, 0x0047, 0x0120, ++ 0x0048, 0x1E22, 0x0049, 0x0130, 0x004D, 0x1E40, 0x004E, 0x1E44, ++ 0x004F, 0x022E, 0x0050, 0x1E56, 0x0052, 0x1E58, 0x0053, 0x1E60, ++ 0x0054, 0x1E6A, 0x0057, 0x1E86, 0x0058, 0x1E8A, 0x0059, 0x1E8E, ++ 0x005A, 0x017B, 0x0061, 0x0227, 0x0062, 0x1E03, 0x0063, 0x010B, ++ 0x0064, 0x1E0B, 0x0065, 0x0117, 0x0066, 0x1E1F, 0x0067, 0x0121, ++ 0x0068, 0x1E23, 0x006D, 0x1E41, 0x006E, 0x1E45, 0x006F, 0x022F, ++ 0x0070, 0x1E57, 0x0072, 0x1E59, 0x0073, 0x1E61, 0x0074, 0x1E6B, ++ 0x0077, 0x1E87, 0x0078, 0x1E8B, 0x0079, 0x1E8F, 0x007A, 0x017C, ++ 0x015A, 0x1E64, 0x015B, 0x1E65, 0x0160, 0x1E66, 0x0161, 0x1E67, ++ 0x017F, 0x1E9B, 0x1E62, 0x1E68, 0x1E63, 0x1E69, 0x0041, 0x00C4, ++ 0x0045, 0x00CB, 0x0048, 0x1E26, 0x0049, 0x00CF, 0x004F, 0x00D6, ++ 0x0055, 0x00DC, 0x0057, 0x1E84, 0x0058, 0x1E8C, 0x0059, 0x0178, ++ 0x0061, 0x00E4, 0x0065, 0x00EB, 0x0068, 0x1E27, 0x0069, 0x00EF, ++ 0x006F, 0x00F6, 0x0074, 0x1E97, 0x0075, 0x00FC, 0x0077, 0x1E85, ++ 0x0078, 0x1E8D, 0x0079, 0x00FF, 0x00D5, 0x1E4E, 0x00F5, 0x1E4F, ++ 0x016A, 0x1E7A, 0x016B, 0x1E7B, 0x0399, 0x03AA, 0x03A5, 0x03AB, ++ 0x03B9, 0x03CA, 0x03C5, 0x03CB, 0x03D2, 0x03D4, 0x0406, 0x0407, ++ 0x0410, 0x04D2, 0x0415, 0x0401, 0x0416, 0x04DC, 0x0417, 0x04DE, ++ 0x0418, 0x04E4, 0x041E, 0x04E6, 0x0423, 0x04F0, 0x0427, 0x04F4, ++ 0x042B, 0x04F8, 0x042D, 0x04EC, 0x0430, 0x04D3, 0x0435, 0x0451, ++ 0x0436, 0x04DD, 0x0437, 0x04DF, 0x0438, 0x04E5, 0x043E, 0x04E7, ++ 0x0443, 0x04F1, 0x0447, 0x04F5, 0x044B, 0x04F9, 0x044D, 0x04ED, ++ 0x0456, 0x0457, 0x04D8, 0x04DA, 0x04D9, 0x04DB, 0x04E8, 0x04EA, ++ 0x04E9, 0x04EB, 0x0041, 0x1EA2, 0x0045, 0x1EBA, 0x0049, 0x1EC8, ++ 0x004F, 0x1ECE, 0x0055, 0x1EE6, 0x0059, 0x1EF6, 0x0061, 0x1EA3, ++ 0x0065, 0x1EBB, 0x0069, 0x1EC9, 0x006F, 0x1ECF, 0x0075, 0x1EE7, ++ 0x0079, 0x1EF7, 0x00C2, 0x1EA8, 0x00CA, 0x1EC2, 0x00D4, 0x1ED4, ++ 0x00E2, 0x1EA9, 0x00EA, 0x1EC3, 0x00F4, 0x1ED5, 0x0102, 0x1EB2, ++ 0x0103, 0x1EB3, 0x01A0, 0x1EDE, 0x01A1, 0x1EDF, 0x01AF, 0x1EEC, ++ 0x01B0, 0x1EED, 0x0041, 0x00C5, 0x0055, 0x016E, 0x0061, 0x00E5, ++ 0x0075, 0x016F, 0x0077, 0x1E98, 0x0079, 0x1E99, 0x004F, 0x0150, ++ 0x0055, 0x0170, 0x006F, 0x0151, 0x0075, 0x0171, 0x0423, 0x04F2, ++ 0x0443, 0x04F3, 0x0041, 0x01CD, 0x0043, 0x010C, 0x0044, 0x010E, ++ 0x0045, 0x011A, 0x0047, 0x01E6, 0x0048, 0x021E, 0x0049, 0x01CF, ++ 0x004B, 0x01E8, 0x004C, 0x013D, 0x004E, 0x0147, 0x004F, 0x01D1, ++ 0x0052, 0x0158, 0x0053, 0x0160, 0x0054, 0x0164, 0x0055, 0x01D3, ++ 0x005A, 0x017D, 0x0061, 0x01CE, 0x0063, 0x010D, 0x0064, 0x010F, ++ 0x0065, 0x011B, 0x0067, 0x01E7, 0x0068, 0x021F, 0x0069, 0x01D0, ++ 0x006A, 0x01F0, 0x006B, 0x01E9, 0x006C, 0x013E, 0x006E, 0x0148, ++ 0x006F, 0x01D2, 0x0072, 0x0159, 0x0073, 0x0161, 0x0074, 0x0165, ++ 0x0075, 0x01D4, 0x007A, 0x017E, 0x00DC, 0x01D9, 0x00FC, 0x01DA, ++ 0x01B7, 0x01EE, 0x0292, 0x01EF, 0x0041, 0x0200, 0x0045, 0x0204, ++ 0x0049, 0x0208, 0x004F, 0x020C, 0x0052, 0x0210, 0x0055, 0x0214, ++ 0x0061, 0x0201, 0x0065, 0x0205, 0x0069, 0x0209, 0x006F, 0x020D, ++ 0x0072, 0x0211, 0x0075, 0x0215, 0x0474, 0x0476, 0x0475, 0x0477, ++ 0x0041, 0x0202, 0x0045, 0x0206, 0x0049, 0x020A, 0x004F, 0x020E, ++ 0x0052, 0x0212, 0x0055, 0x0216, 0x0061, 0x0203, 0x0065, 0x0207, ++ 0x0069, 0x020B, 0x006F, 0x020F, 0x0072, 0x0213, 0x0075, 0x0217, ++ 0x0391, 0x1F08, 0x0395, 0x1F18, 0x0397, 0x1F28, 0x0399, 0x1F38, ++ 0x039F, 0x1F48, 0x03A9, 0x1F68, 0x03B1, 0x1F00, 0x03B5, 0x1F10, ++ 0x03B7, 0x1F20, 0x03B9, 0x1F30, 0x03BF, 0x1F40, 0x03C1, 0x1FE4, ++ 0x03C5, 0x1F50, 0x03C9, 0x1F60, 0x0391, 0x1F09, 0x0395, 0x1F19, ++ 0x0397, 0x1F29, 0x0399, 0x1F39, 0x039F, 0x1F49, 0x03A1, 0x1FEC, ++ 0x03A5, 0x1F59, 0x03A9, 0x1F69, 0x03B1, 0x1F01, 0x03B5, 0x1F11, ++ 0x03B7, 0x1F21, 0x03B9, 0x1F31, 0x03BF, 0x1F41, 0x03C1, 0x1FE5, ++ 0x03C5, 0x1F51, 0x03C9, 0x1F61, 0x004F, 0x01A0, 0x0055, 0x01AF, ++ 0x006F, 0x01A1, 0x0075, 0x01B0, 0x0041, 0x1EA0, 0x0042, 0x1E04, ++ 0x0044, 0x1E0C, 0x0045, 0x1EB8, 0x0048, 0x1E24, 0x0049, 0x1ECA, ++ 0x004B, 0x1E32, 0x004C, 0x1E36, 0x004D, 0x1E42, 0x004E, 0x1E46, ++ 0x004F, 0x1ECC, 0x0052, 0x1E5A, 0x0053, 0x1E62, 0x0054, 0x1E6C, ++ 0x0055, 0x1EE4, 0x0056, 0x1E7E, 0x0057, 0x1E88, 0x0059, 0x1EF4, ++ 0x005A, 0x1E92, 0x0061, 0x1EA1, 0x0062, 0x1E05, 0x0064, 0x1E0D, ++ 0x0065, 0x1EB9, 0x0068, 0x1E25, 0x0069, 0x1ECB, 0x006B, 0x1E33, ++ 0x006C, 0x1E37, 0x006D, 0x1E43, 0x006E, 0x1E47, 0x006F, 0x1ECD, ++ 0x0072, 0x1E5B, 0x0073, 0x1E63, 0x0074, 0x1E6D, 0x0075, 0x1EE5, ++ 0x0076, 0x1E7F, 0x0077, 0x1E89, 0x0079, 0x1EF5, 0x007A, 0x1E93, ++ 0x01A0, 0x1EE2, 0x01A1, 0x1EE3, 0x01AF, 0x1EF0, 0x01B0, 0x1EF1, ++ 0x0055, 0x1E72, 0x0075, 0x1E73, 0x0041, 0x1E00, 0x0061, 0x1E01, ++ 0x0053, 0x0218, 0x0054, 0x021A, 0x0073, 0x0219, 0x0074, 0x021B, ++ 0x0043, 0x00C7, 0x0044, 0x1E10, 0x0045, 0x0228, 0x0047, 0x0122, ++ 0x0048, 0x1E28, 0x004B, 0x0136, 0x004C, 0x013B, 0x004E, 0x0145, ++ 0x0052, 0x0156, 0x0053, 0x015E, 0x0054, 0x0162, 0x0063, 0x00E7, ++ 0x0064, 0x1E11, 0x0065, 0x0229, 0x0067, 0x0123, 0x0068, 0x1E29, ++ 0x006B, 0x0137, 0x006C, 0x013C, 0x006E, 0x0146, 0x0072, 0x0157, ++ 0x0073, 0x015F, 0x0074, 0x0163, 0x0041, 0x0104, 0x0045, 0x0118, ++ 0x0049, 0x012E, 0x004F, 0x01EA, 0x0055, 0x0172, 0x0061, 0x0105, ++ 0x0065, 0x0119, 0x0069, 0x012F, 0x006F, 0x01EB, 0x0075, 0x0173, ++ 0x0044, 0x1E12, 0x0045, 0x1E18, 0x004C, 0x1E3C, 0x004E, 0x1E4A, ++ 0x0054, 0x1E70, 0x0055, 0x1E76, 0x0064, 0x1E13, 0x0065, 0x1E19, ++ 0x006C, 0x1E3D, 0x006E, 0x1E4B, 0x0074, 0x1E71, 0x0075, 0x1E77, ++ 0x0048, 0x1E2A, 0x0068, 0x1E2B, 0x0045, 0x1E1A, 0x0049, 0x1E2C, ++ 0x0055, 0x1E74, 0x0065, 0x1E1B, 0x0069, 0x1E2D, 0x0075, 0x1E75, ++ 0x0042, 0x1E06, 0x0044, 0x1E0E, 0x004B, 0x1E34, 0x004C, 0x1E3A, ++ 0x004E, 0x1E48, 0x0052, 0x1E5E, 0x0054, 0x1E6E, 0x005A, 0x1E94, ++ 0x0062, 0x1E07, 0x0064, 0x1E0F, 0x0068, 0x1E96, 0x006B, 0x1E35, ++ 0x006C, 0x1E3B, 0x006E, 0x1E49, 0x0072, 0x1E5F, 0x0074, 0x1E6F, ++ 0x007A, 0x1E95, 0x003C, 0x226E, 0x003D, 0x2260, 0x003E, 0x226F, ++ 0x2190, 0x219A, 0x2192, 0x219B, 0x2194, 0x21AE, 0x21D0, 0x21CD, ++ 0x21D2, 0x21CF, 0x21D4, 0x21CE, 0x2203, 0x2204, 0x2208, 0x2209, ++ 0x220B, 0x220C, 0x2223, 0x2224, 0x2225, 0x2226, 0x223C, 0x2241, ++ 0x2243, 0x2244, 0x2245, 0x2247, 0x2248, 0x2249, 0x224D, 0x226D, ++ 0x2261, 0x2262, 0x2264, 0x2270, 0x2265, 0x2271, 0x2272, 0x2274, ++ 0x2273, 0x2275, 0x2276, 0x2278, 0x2277, 0x2279, 0x227A, 0x2280, ++ 0x227B, 0x2281, 0x227C, 0x22E0, 0x227D, 0x22E1, 0x2282, 0x2284, ++ 0x2283, 0x2285, 0x2286, 0x2288, 0x2287, 0x2289, 0x2291, 0x22E2, ++ 0x2292, 0x22E3, 0x22A2, 0x22AC, 0x22A8, 0x22AD, 0x22A9, 0x22AE, ++ 0x22AB, 0x22AF, 0x22B2, 0x22EA, 0x22B3, 0x22EB, 0x22B4, 0x22EC, ++ 0x22B5, 0x22ED, 0x00A8, 0x1FC1, 0x03B1, 0x1FB6, 0x03B7, 0x1FC6, ++ 0x03B9, 0x1FD6, 0x03C5, 0x1FE6, 0x03C9, 0x1FF6, 0x03CA, 0x1FD7, ++ 0x03CB, 0x1FE7, 0x1F00, 0x1F06, 0x1F01, 0x1F07, 0x1F08, 0x1F0E, ++ 0x1F09, 0x1F0F, 0x1F20, 0x1F26, 0x1F21, 0x1F27, 0x1F28, 0x1F2E, ++ 0x1F29, 0x1F2F, 0x1F30, 0x1F36, 0x1F31, 0x1F37, 0x1F38, 0x1F3E, ++ 0x1F39, 0x1F3F, 0x1F50, 0x1F56, 0x1F51, 0x1F57, 0x1F59, 0x1F5F, ++ 0x1F60, 0x1F66, 0x1F61, 0x1F67, 0x1F68, 0x1F6E, 0x1F69, 0x1F6F, ++ 0x1FBF, 0x1FCF, 0x1FFE, 0x1FDF, 0x0391, 0x1FBC, 0x0397, 0x1FCC, ++ 0x03A9, 0x1FFC, 0x03AC, 0x1FB4, 0x03AE, 0x1FC4, 0x03B1, 0x1FB3, ++ 0x03B7, 0x1FC3, 0x03C9, 0x1FF3, 0x03CE, 0x1FF4, 0x1F00, 0x1F80, ++ 0x1F01, 0x1F81, 0x1F02, 0x1F82, 0x1F03, 0x1F83, 0x1F04, 0x1F84, ++ 0x1F05, 0x1F85, 0x1F06, 0x1F86, 0x1F07, 0x1F87, 0x1F08, 0x1F88, ++ 0x1F09, 0x1F89, 0x1F0A, 0x1F8A, 0x1F0B, 0x1F8B, 0x1F0C, 0x1F8C, ++ 0x1F0D, 0x1F8D, 0x1F0E, 0x1F8E, 0x1F0F, 0x1F8F, 0x1F20, 0x1F90, ++ 0x1F21, 0x1F91, 0x1F22, 0x1F92, 0x1F23, 0x1F93, 0x1F24, 0x1F94, ++ 0x1F25, 0x1F95, 0x1F26, 0x1F96, 0x1F27, 0x1F97, 0x1F28, 0x1F98, ++ 0x1F29, 0x1F99, 0x1F2A, 0x1F9A, 0x1F2B, 0x1F9B, 0x1F2C, 0x1F9C, ++ 0x1F2D, 0x1F9D, 0x1F2E, 0x1F9E, 0x1F2F, 0x1F9F, 0x1F60, 0x1FA0, ++ 0x1F61, 0x1FA1, 0x1F62, 0x1FA2, 0x1F63, 0x1FA3, 0x1F64, 0x1FA4, ++ 0x1F65, 0x1FA5, 0x1F66, 0x1FA6, 0x1F67, 0x1FA7, 0x1F68, 0x1FA8, ++ 0x1F69, 0x1FA9, 0x1F6A, 0x1FAA, 0x1F6B, 0x1FAB, 0x1F6C, 0x1FAC, ++ 0x1F6D, 0x1FAD, 0x1F6E, 0x1FAE, 0x1F6F, 0x1FAF, 0x1F70, 0x1FB2, ++ 0x1F74, 0x1FC2, 0x1F7C, 0x1FF2, 0x1FB6, 0x1FB7, 0x1FC6, 0x1FC7, ++ 0x1FF6, 0x1FF7, 0x0627, 0x0622, 0x0627, 0x0623, 0x0648, 0x0624, ++ 0x064A, 0x0626, 0x06C1, 0x06C2, 0x06D2, 0x06D3, 0x06D5, 0x06C0, ++ 0x0627, 0x0625, 0x0928, 0x0929, 0x0930, 0x0931, 0x0933, 0x0934, ++ 0x09C7, 0x09CB, 0x09C7, 0x09CC, 0x0B47, 0x0B4B, 0x0B47, 0x0B48, ++ 0x0B47, 0x0B4C, 0x0BC6, 0x0BCA, 0x0BC7, 0x0BCB, 0x0B92, 0x0B94, ++ 0x0BC6, 0x0BCC, 0x0C46, 0x0C48, 0x0CC6, 0x0CCA, 0x0CBF, 0x0CC0, ++ 0x0CC6, 0x0CC7, 0x0CCA, 0x0CCB, 0x0CC6, 0x0CC8, 0x0D46, 0x0D4A, ++ 0x0D47, 0x0D4B, 0x0D46, 0x0D4C, 0x0DD9, 0x0DDA, 0x0DDC, 0x0DDD, ++ 0x0DD9, 0x0DDC, 0x0DD9, 0x0DDE, 0x1025, 0x1026, 0x3046, 0x3094, ++ 0x304B, 0x304C, 0x304D, 0x304E, 0x304F, 0x3050, 0x3051, 0x3052, ++ 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, ++ 0x305B, 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, ++ 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306F, 0x3070, ++ 0x3072, 0x3073, 0x3075, 0x3076, 0x3078, 0x3079, 0x307B, 0x307C, ++ 0x309D, 0x309E, 0x30A6, 0x30F4, 0x30AB, 0x30AC, 0x30AD, 0x30AE, ++ 0x30AF, 0x30B0, 0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, ++ 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, ++ 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C4, 0x30C5, 0x30C6, 0x30C7, ++ 0x30C8, 0x30C9, 0x30CF, 0x30D0, 0x30D2, 0x30D3, 0x30D5, 0x30D6, ++ 0x30D8, 0x30D9, 0x30DB, 0x30DC, 0x30EF, 0x30F7, 0x30F0, 0x30F8, ++ 0x30F1, 0x30F9, 0x30F2, 0x30FA, 0x30FD, 0x30FE, 0x306F, 0x3071, ++ 0x3072, 0x3074, 0x3075, 0x3077, 0x3078, 0x307A, 0x307B, 0x307D, ++ 0x30CF, 0x30D1, 0x30D2, 0x30D4, 0x30D5, 0x30D7, 0x30D8, 0x30DA, ++ 0x30DB, 0x30DD ++}; ++ ++static const u_int8_t ++__CFUniCharCombiningBitmap[] = { ++ 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, ++ 0x00, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, ++ 0x0D, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, ++ 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x13, 0x00, ++ ++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x78, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0xFE, 0xFF, 0xFB, 0xFF, 0xFF, 0xBB, ++ 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0xC0, 0xFF, 0x9F, 0x3D, 0x00, 0x00, ++ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xFF, 0xFF, ++ 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x01, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, ++ 0xFF, 0x3F, 0x1E, 0x00, 0x0C, 0x00, 0x00, 0x00, ++ 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, ++ 0x9F, 0x39, 0x80, 0x00, 0x0C, 0x00, 0x00, 0x00, ++ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, ++ 0x87, 0x39, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, ++ 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, ++ 0xBF, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, ++ 0x8F, 0x39, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, ++ 0xC7, 0x3D, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, ++ 0xDF, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, ++ 0xDF, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, ++ 0xCF, 0x3D, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x84, 0x5F, 0xFF, 0x00, 0x00, 0x0C, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x07, ++ 0x80, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x1B, ++ 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xA0, 0xC2, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, ++ 0xDF, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, ++ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xC7, 0x03, ++ 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x00, ++ 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, ++ 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x3F, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, ++ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ++}; ++ ++/* Surrogate Pair Constants */ ++#define SP_HALF_SHIFT 10 ++#define SP_HALF_BASE 0x0010000U ++#define SP_HALF_MASK 0x3FFU ++ ++#define SP_HIGH_FIRST 0xD800U ++#define SP_HIGH_LAST 0xDBFFU ++#define SP_LOW_FIRST 0xDC00U ++#define SP_LOW_LAST 0xDFFFU ++ ++/* ++ * Test for a combining character. ++ * ++ * Similar to __CFUniCharIsNonBaseCharacter except that ++ * unicode_combinable also includes Hangul Jamo characters. ++ */ ++static inline int ++unicode_combinable(u_int16_t character) ++{ ++ const u_int8_t *bitmap = __CFUniCharCombiningBitmap; ++ u_int8_t value; ++ ++ if (character < 0x0300) ++ return (0); ++ ++ value = bitmap[(character >> 8) & 0xFF]; ++ ++ if (value == 0xFF) { ++ return (1); ++ } else if (value) { ++ bitmap = bitmap + ((value - 1) * 32) + 256; ++ return (bitmap[(character & 0xFF) / 8] & (1 << (character % 8)) ? 1 : 0); ++ } ++ return (0); ++} ++ ++/* ++ * Test for a precomposed character. ++ * ++ * Similar to __CFUniCharIsDecomposableCharacter. ++ */ ++static inline int ++unicode_decomposeable(u_int16_t character) { ++ const u_int8_t *bitmap = __CFUniCharDecomposableBitmap; ++ u_int8_t value; ++ ++ if (character < 0x00C0) ++ return (0); ++ ++ value = bitmap[(character >> 8) & 0xFF]; ++ ++ if (value == 0xFF) { ++ return (1); ++ } else if (value) { ++ bitmap = bitmap + ((value - 1) * 32) + 256; ++ return (bitmap[(character & 0xFF) / 8] & (1 << (character % 8)) ? 1 : 0); ++ } ++ return (0); ++} ++ ++static int unicode_decompose(u_int16_t character, u_int16_t *convertedChars); ++static u_int16_t unicode_combine(u_int16_t base, u_int16_t combining); ++ ++char utf_extrabytes[32] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 2, 2, 3, -1 ++}; ++ ++/* ++ * utf8_encodestr - Encodes a Unicode string to UTF-8 ++ * ++ * NOTES: ++ * The resulting UTF-8 string is NULL terminated. ++ * ++ * If '/' chars are not allowed on disk then an alternate ++ * (replacement) char must be provided in altslash. ++ * ++ * input flags: ++ * UTF_REVERSE_ENDIAN: Unicode byteorder is opposite current runtime ++ * UTF_NO_NULL_TERM: don't add NULL termination to UTF-8 output ++ * ++ * result: ++ * ENAMETOOLONG: Name didn't fit; only buflen bytes were encoded ++ * EINVAL: Illegal char found; char was replaced by an '_'. ++ */ ++int ++utf8_encodestr(const u_int16_t * ucsp, size_t ucslen, u_int8_t * utf8p, ++ size_t * utf8len, size_t buflen, u_int16_t altslash, int flags) ++{ ++ u_int8_t * bufstart; ++ u_int8_t * bufend; ++ u_int16_t ucs_ch; ++ u_int16_t * chp = NULL; ++ u_int16_t sequence[8]; ++ int extra = 0; ++ size_t charcnt; ++ int swapbytes = (flags & UTF_REVERSE_ENDIAN); ++ int nullterm = ((flags & UTF_NO_NULL_TERM) == 0); ++ int decompose = (flags & UTF_DECOMPOSED); ++ int result = 0; ++ ++ bufstart = utf8p; ++ bufend = bufstart + buflen; ++ if (nullterm) ++ --bufend; ++ charcnt = ucslen / 2; ++ ++ while (charcnt-- > 0) { ++ if (extra > 0) { ++ --extra; ++ ucs_ch = *chp++; ++ } else { ++ ucs_ch = swapbytes ? OSSwapInt16(*ucsp++) : *ucsp++; ++ ++ if (decompose && unicode_decomposeable(ucs_ch)) { ++ extra = unicode_decompose(ucs_ch, sequence) - 1; ++ charcnt += extra; ++ ucs_ch = sequence[0]; ++ chp = &sequence[1]; ++ } ++ } ++ ++ if (ucs_ch < 0x0080) { ++ if (utf8p >= bufend) { ++ result = ENAMETOOLONG; ++ break; ++ } ++ *utf8p++ = ucs_ch; ++ ++ } else if (ucs_ch < 0x800) { ++ if ((utf8p + 1) >= bufend) { ++ result = ENAMETOOLONG; ++ break; ++ } ++ *utf8p++ = 0xc0 | (ucs_ch >> 6); ++ *utf8p++ = 0x80 | (0x3f & ucs_ch); ++ ++ } else { ++ /* Combine valid surrogate pairs */ ++ if (ucs_ch >= SP_HIGH_FIRST && ucs_ch <= SP_HIGH_LAST ++ && charcnt > 0) { ++ u_int16_t ch2; ++ u_int32_t pair; ++ ++ ch2 = swapbytes ? OSSwapInt16(*ucsp) : *ucsp; ++ if (ch2 >= SP_LOW_FIRST && ch2 <= SP_LOW_LAST) { ++ pair = ((ucs_ch - SP_HIGH_FIRST) << SP_HALF_SHIFT) ++ + (ch2 - SP_LOW_FIRST) + SP_HALF_BASE; ++ if ((utf8p + 3) >= bufend) { ++ result = ENAMETOOLONG; ++ break; ++ } ++ --charcnt; ++ ++ucsp; ++ *utf8p++ = 0xf0 | (pair >> 18); ++ *utf8p++ = 0x80 | (0x3f & (pair >> 12)); ++ *utf8p++ = 0x80 | (0x3f & (pair >> 6)); ++ *utf8p++ = 0x80 | (0x3f & pair); ++ continue; ++ } ++ } ++ if ((utf8p + 2) >= bufend) { ++ result = ENAMETOOLONG; ++ break; ++ } ++ *utf8p++ = 0xe0 | (ucs_ch >> 12); ++ *utf8p++ = 0x80 | (0x3f & (ucs_ch >> 6)); ++ *utf8p++ = 0x80 | (0x3f & ucs_ch); ++ } ++ } ++ ++ *utf8len = utf8p - bufstart; ++ if (nullterm) ++ *utf8p++ = '\0'; ++ ++ return (result); ++} ++ ++ ++/* ++ * utf8_decodestr - Decodes a UTF-8 string back to Unicode ++ * ++ * NOTES: ++ * The input UTF-8 string does not need to be null terminated ++ * if utf8len is set. ++ * ++ * If '/' chars are not allowed on disk then an alternate ++ * (replacement) char must be provided in altslash. ++ * ++ * input flags: ++ * UTF_REV_ENDIAN: Unicode byteorder is oposite current runtime ++ * UTF_DECOMPOSED: Unicode output string must be fully decompsed ++ * ++ * result: ++ * ENAMETOOLONG: Name didn't fit; only ucslen chars were decoded. ++ * EINVAL: Illegal UTF-8 sequence found. ++ */ ++int ++utf8_decodestr(const u_int8_t* utf8p, size_t utf8len, u_int16_t* ucsp, ++ size_t *ucslen, size_t buflen, u_int16_t altslash, int flags, size_t *consumed) ++{ ++ u_int16_t* bufstart; ++ u_int16_t* bufend; ++ unsigned int ucs_ch; ++ unsigned int byte; ++ int result = 0; ++ int decompose, precompose, swapbytes; ++ const u_int8_t *utf8start, *utf8lastpass; ++ ++ decompose = (flags & UTF_DECOMPOSED); ++ precompose = (flags & UTF_PRECOMPOSED); ++ swapbytes = (flags & UTF_REVERSE_ENDIAN); ++ ++ bufstart = ucsp; ++ bufend = (u_int16_t *)((u_int8_t *)ucsp + buflen); ++ utf8start = utf8p; ++ ++ while (utf8len-- > 0) { ++ byte = *utf8p++; ++ ++ if (ucsp >= bufend) ++ goto toolong; ++ ++ /* check for ascii */ ++ if (byte < 0x80) { ++ ucs_ch = byte; /* 1st byte */ ++ } else { ++ u_int32_t ch; ++ int extrabytes = utf_extrabytes[byte >> 3]; ++ ++ if (utf8len < extrabytes) ++ goto invalid; ++ utf8len -= extrabytes; ++ ++ switch (extrabytes) { ++ case 1: ++ ch = byte; ch <<= 6; /* 1st byte */ ++ byte = *utf8p++; /* 2nd byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ++ ch -= 0x00003080U; ++ if (ch < 0x0080) ++ goto invalid; ++ ucs_ch = ch; ++ break; ++ case 2: ++ ch = byte; ch <<= 6; /* 1st byte */ ++ byte = *utf8p++; /* 2nd byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ch <<= 6; ++ byte = *utf8p++; /* 3rd byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ++ ch -= 0x000E2080U; ++ if (ch < 0x0800) ++ goto invalid; ++ if (ch >= 0xD800) { ++ if (ch <= 0xDFFF) ++ goto invalid; ++ if (ch == 0xFFFE || ch == 0xFFFF) ++ goto invalid; ++ } ++ ucs_ch = ch; ++ break; ++ case 3: ++ ch = byte; ch <<= 6; /* 1st byte */ ++ byte = *utf8p++; /* 2nd byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ch <<= 6; ++ byte = *utf8p++; /* 3rd byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ch <<= 6; ++ byte = *utf8p++; /* 4th byte */ ++ if ((byte >> 6) != 2) ++ goto invalid; ++ ch += byte; ++ ch -= 0x03C82080U + SP_HALF_BASE; ++ ucs_ch = (ch >> SP_HALF_SHIFT) + SP_HIGH_FIRST; ++ if (ucs_ch < SP_HIGH_FIRST || ucs_ch > SP_HIGH_LAST) ++ goto invalid; ++ *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : ucs_ch; ++ if (ucsp >= bufend) ++ goto toolong; ++ ucs_ch = (ch & SP_HALF_MASK) + SP_LOW_FIRST; ++ if (ucs_ch < SP_LOW_FIRST || ucs_ch > SP_LOW_LAST) ++ goto invalid; ++ *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : ucs_ch; ++ continue; ++ default: ++ goto invalid; ++ } ++ } ++ if (precompose && (ucsp != bufstart)) { ++ u_int16_t composite, base; ++ ++ if (unicode_combinable(ucs_ch)) { ++ base = swapbytes ? OSSwapInt16(*(ucsp - 1)) : *(ucsp - 1); ++ composite = unicode_combine(base, ucs_ch); ++ if (composite) { ++ --ucsp; ++ ucs_ch = composite; ++ } else { ++ goto exit; ++ } ++ } else { ++ goto exit; ++ } ++ } ++ *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : ucs_ch; ++ utf8lastpass = utf8p; ++ } ++ ++exit: ++ *ucslen = (u_int8_t*)ucsp - (u_int8_t*)bufstart; ++ *consumed = utf8lastpass - utf8start; ++ return (result); ++ ++invalid: ++ result = EINVAL; ++ goto exit; ++ ++toolong: ++ result = ENAMETOOLONG; ++ goto exit; ++} ++ ++ /* ++ * Unicode 3.2 decomposition code (derived from Core Foundation) ++ */ ++ ++typedef struct { ++ u_int32_t _key; ++ u_int32_t _value; ++} unicode_mappings32; ++ ++static inline u_int32_t ++getmappedvalue32(const unicode_mappings32 *theTable, u_int32_t numElem, ++ u_int16_t character) ++{ ++ const unicode_mappings32 *p, *q, *divider; ++ ++ if ((character < theTable[0]._key) || (character > theTable[numElem-1]._key)) ++ return (0); ++ ++ p = theTable; ++ q = p + (numElem-1); ++ while (p <= q) { ++ divider = p + ((q - p) >> 1); /* divide by 2 */ ++ if (character < divider->_key) { q = divider - 1; } ++ else if (character > divider->_key) { p = divider + 1; } ++ else { return (divider->_value); } ++ } ++ return (0); ++} ++ ++#define RECURSIVE_DECOMPOSITION (1 << 15) ++#define EXTRACT_COUNT(value) (((value) >> 12) & 0x0007) ++ ++typedef struct { ++ u_int16_t _key; ++ u_int16_t _value; ++} unicode_mappings16; ++ ++static inline u_int16_t ++getmappedvalue16(const unicode_mappings16 *theTable, u_int32_t numElem, ++ u_int16_t character) ++{ ++ const unicode_mappings16 *p, *q, *divider; ++ ++ if ((character < theTable[0]._key) || (character > theTable[numElem-1]._key)) ++ return (0); ++ ++ p = theTable; ++ q = p + (numElem-1); ++ while (p <= q) { ++ divider = p + ((q - p) >> 1); /* divide by 2 */ ++ if (character < divider->_key) ++ q = divider - 1; ++ else if (character > divider->_key) ++ p = divider + 1; ++ else ++ return (divider->_value); ++ } ++ return (0); ++} ++ ++ ++static u_int32_t ++unicode_recursive_decompose(u_int16_t character, u_int16_t *convertedChars) ++{ ++ u_int16_t value; ++ u_int32_t length; ++ u_int16_t firstChar; ++ u_int16_t theChar; ++ const u_int16_t *bmpMappings; ++ u_int32_t usedLength; ++ ++ value = getmappedvalue16( ++ (const unicode_mappings16 *)__CFUniCharDecompositionTable, ++ __UniCharDecompositionTableLength, character); ++ length = EXTRACT_COUNT(value); ++ firstChar = value & 0x0FFF; ++ theChar = firstChar; ++ bmpMappings = (length == 1 ? &theChar : __CFUniCharMultipleDecompositionTable + firstChar); ++ usedLength = 0; ++ ++ if (value & RECURSIVE_DECOMPOSITION) { ++ usedLength = unicode_recursive_decompose((u_int16_t)*bmpMappings, convertedChars); ++ ++ --length; /* Decrement for the first char */ ++ if (!usedLength) ++ return 0; ++ ++bmpMappings; ++ convertedChars += usedLength; ++ } ++ ++ usedLength += length; ++ ++ while (length--) ++ *(convertedChars++) = *(bmpMappings++); ++ ++ return (usedLength); ++} ++ ++#define HANGUL_SBASE 0xAC00 ++#define HANGUL_LBASE 0x1100 ++#define HANGUL_VBASE 0x1161 ++#define HANGUL_TBASE 0x11A7 ++ ++#define HANGUL_SCOUNT 11172 ++#define HANGUL_LCOUNT 19 ++#define HANGUL_VCOUNT 21 ++#define HANGUL_TCOUNT 28 ++#define HANGUL_NCOUNT (HANGUL_VCOUNT * HANGUL_TCOUNT) ++ ++/* ++ * unicode_decompose - decompose a composed Unicode char ++ * ++ * Composed Unicode characters are forbidden on ++ * HFS Plus volumes. ucs_decompose will convert a ++ * composed character into its correct decomposed ++ * sequence. ++ * ++ * Similar to CFUniCharDecomposeCharacter ++ */ ++static int ++unicode_decompose(u_int16_t character, u_int16_t *convertedChars) ++{ ++ if ((character >= HANGUL_SBASE) && ++ (character <= (HANGUL_SBASE + HANGUL_SCOUNT))) { ++ u_int32_t length; ++ ++ character -= HANGUL_SBASE; ++ length = (character % HANGUL_TCOUNT ? 3 : 2); ++ ++ *(convertedChars++) = ++ character / HANGUL_NCOUNT + HANGUL_LBASE; ++ *(convertedChars++) = ++ (character % HANGUL_NCOUNT) / HANGUL_TCOUNT + HANGUL_VBASE; ++ if (length > 2) ++ *convertedChars = (character % HANGUL_TCOUNT) + HANGUL_TBASE; ++ return (length); ++ } else { ++ return (unicode_recursive_decompose(character, convertedChars)); ++ } ++} ++ ++/* ++ * unicode_combine - generate a precomposed Unicode char ++ * ++ * Precomposed Unicode characters are required for some volume ++ * formats and network protocols. unicode_combine will combine ++ * a decomposed character sequence into a single precomposed ++ * (composite) character. ++ * ++ * Similar toCFUniCharPrecomposeCharacter but unicode_combine ++ * also handles Hangul Jamo characters. ++ */ ++static u_int16_t ++unicode_combine(u_int16_t base, u_int16_t combining) ++{ ++ u_int32_t value; ++ ++ /* Check HANGUL */ ++ if ((combining >= HANGUL_VBASE) && (combining < (HANGUL_TBASE + HANGUL_TCOUNT))) { ++ /* 2 char Hangul sequences */ ++ if ((combining < (HANGUL_VBASE + HANGUL_VCOUNT)) && ++ (base >= HANGUL_LBASE && base < (HANGUL_LBASE + HANGUL_LCOUNT))) { ++ return (HANGUL_SBASE + ++ ((base - HANGUL_LBASE)*(HANGUL_VCOUNT*HANGUL_TCOUNT)) + ++ ((combining - HANGUL_VBASE)*HANGUL_TCOUNT)); ++ } ++ ++ /* 3 char Hangul sequences */ ++ if ((combining > HANGUL_TBASE) && ++ (base >= HANGUL_SBASE && base < (HANGUL_SBASE + HANGUL_SCOUNT))) { ++ if ((base - HANGUL_SBASE) % HANGUL_TCOUNT) ++ return (0); ++ else ++ return (base + (combining - HANGUL_TBASE)); ++ } ++ } ++ ++ value = getmappedvalue32( ++ (const unicode_mappings32 *)__CFUniCharPrecompSourceTable, ++ __CFUniCharPrecompositionTableLength, combining); ++ ++ if (value) { ++ value = getmappedvalue16( ++ (const unicode_mappings16 *) ++ ((u_int32_t *)__CFUniCharBMPPrecompDestinationTable + (value & 0xFFFF)), ++ (value >> 16), base); ++ } ++ return (value); ++} ++ ++static int ++utf8mac_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) ++{ ++ u_int16_t ucsp[13]; ++ size_t ucslen = 0, consumed = 0; ++ int ret; ++ int flags; ++ ++ bzero(&ucsp, sizeof(ucsp)); ++ *pwc = 0; ++ flags = UTF_PRECOMPOSED; ++ ++#ifdef __LITTLE_ENDIAN__ ++ flags |= UTF_REVERSE_ENDIAN; ++#endif ++ ++ ret = utf8_decodestr(s, n, ucsp, &ucslen, sizeof(ucsp), 0, flags, &consumed); ++ ++ if (ret == ENAMETOOLONG) /* Name didn't fit; only ucslen chars were decoded */ ++ return RET_TOOFEW(0); ++ ++ if ( ret == EINVAL) /* Illegal UTF-8 sequence found */ ++ return RET_ILSEQ; ++ ++ if((ret = ucs2_mbtowc(conv, pwc, (const unsigned char *) ucsp, ucslen)) < 0) ++ return ret; ++ ++ return (int)consumed; ++} ++ ++static int ++utf8mac_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) /* n == 0 is acceptable */ ++{ ++ int ret; ++ size_t len; ++ u_int16_t ucs_string[13]; ++ int flags; ++ ++ if((ret = ucs2_wctomb(conv, (unsigned char *) ucs_string, wc, sizeof(ucs_string))) < 0) ++ return ret; ++ ++ flags = UTF_NO_NULL_TERM | UTF_DECOMPOSED; ++#ifdef __LITTLE_ENDIAN__ ++ flags |= UTF_REVERSE_ENDIAN; ++#endif ++ utf8_encodestr(ucs_string, ret, r, &len, n, 0, flags); ++ ++ return (int)len; ++} diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/repodata_record.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..7ebc53364049910584d9ea0ce44278840af26811 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/repodata_record.json @@ -0,0 +1,22 @@ +{ + "arch": "x86_64", + "build": "h75a1612_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14" + ], + "fn": "libiconv-1.18-h75a1612_0.conda", + "license": "LGPL-2.1-only", + "md5": "14e4ca2d3797abc3c78ca0ce0e3d9c17", + "name": "libiconv", + "platform": "linux", + "sha256": "8852881ce7522ad4b9eb45ba94cd353f6b381ffd3f9fb5d31426ce2abd8c3ab0", + "size": 789520, + "subdir": "linux-64", + "timestamp": 1771491869000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libiconv-1.18-h75a1612_0.conda", + "version": "1.18" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/run_exports.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..84e4b09033f7a59049083f052fe2683c25ea50ce --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libiconv >=1.18,<2.0a0"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/run_test.sh b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d74bb0eac3e54b3992200b677d1aaf8f787450da --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/run_test.sh @@ -0,0 +1,15 @@ + + +set -ex + + + +iconv -l +test ! -f ${PREFIX}/bin/iconv +test_man_files=$(jq '.files[] | select( . | startswith("share/man"))' $CONDA_PREFIX/conda-meta/libiconv-1.18-${PKG_BUILD_STRING}.json) +if [[ ${test_man_files} ]]; then echo "found GPL licensed files being packaged ${test_man_files}"; exit 1; fi +test_doc_files=$(jq '.files[] | select( . | startswith("share/doc"))' $CONDA_PREFIX/conda-meta/libiconv-1.18-${PKG_BUILD_STRING}.json) +if [[ ${test_doc_files} ]]; then echo "found GPL licensed files being packaged ${test_doc_files}"; exit 1; fi +test -f $PREFIX/lib/libiconv${SHLIB_EXT} +test -f $PREFIX/lib/libcharset${SHLIB_EXT} +exit 0 diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/test_time_dependencies.json b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..da3704064cf4c20a2092a19ce5a634d6639601a6 --- /dev/null +++ b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["jq"] \ No newline at end of file diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.a b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.a new file mode 100644 index 0000000000000000000000000000000000000000..e721a451cb34e098da40eeca32082b52b3d4a209 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.a differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so new file mode 100644 index 0000000000000000000000000000000000000000..65d8693e7fe19c6c3ad97dced14631daa7894bad Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1 b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1 new file mode 100644 index 0000000000000000000000000000000000000000..65d8693e7fe19c6c3ad97dced14631daa7894bad Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1 differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1.0.0 b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..65d8693e7fe19c6c3ad97dced14631daa7894bad Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/lib/libcharset.so.1.0.0 differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/af/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/af/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..b741734cb9fcc20333dc7831ae84b5550f97d7dc Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/af/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/be/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/be/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..64acf0b3f20a2e6c0f094552155d84bf14f22d26 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/be/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/bg/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/bg/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..a7f5b10ae33060f40d4f2be3e01fb85540c28ddf Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/bg/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ca/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ca/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..07077cf92b777ab43dbd061a960d4fe449a59020 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ca/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/cs/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/cs/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..a6733f1b91db3484ee2739a57b1d7d490835589a Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/cs/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/da/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/da/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..0b3195ae05942527597594eb50e73f27d83d63e2 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/da/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/de/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/de/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..dd186a16a1a1e4da43bbbfd5387f941778729444 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/de/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/el/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/el/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..f55c001f33c953d40575d9e4152bdf85e573de54 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/el/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/eo/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/eo/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..4a9bae988af3147e9addfd9948a320335293c96b Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/eo/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/es/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/es/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..08c11a41005bc545f4d6fea1647d625cf4419db6 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/es/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/et/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/et/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..d14af36a170f4fd9212b81926ee295d7c0fb2fc9 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/et/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fi/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fi/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..a823cfa63ee300a9ab830ab588624ba81cc707b3 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fi/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fr/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fr/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..b48e8b1fb2b270abe4909d827ceb11faeea0d403 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/fr/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ga/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ga/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..bfe7815d577a335f3fde61d914a48ad4fcabd51f Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ga/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/gl/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/gl/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..a36919ec5455a00f4c83d6f0e7c8ea0113db1b51 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/gl/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hr/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hr/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..3141380772a3567b511b6c99ae72f7156d7ebf2f Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hr/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hu/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hu/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..ab71d5a670e1d307add497c90c59ab7e7d656899 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/hu/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/id/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/id/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..0d4ebf332e55bbe45dbadc84836e8931a0bbc5bf Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/id/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/it/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/it/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..de0e55476b9b5d371ffd02b45b33a59f88e968b1 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/it/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ja/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ja/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..d440fe4e68ac45d85459deac316a0c8c63a287f0 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ja/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ka/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ka/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..e445788bac117e84eeee8a4b6fe5e668245a0902 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ka/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ko/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ko/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..47cf3a2debd2c416bad5b67005e394baa0c64d8f Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ko/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/lt/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/lt/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..a5bf00588c19a4e1f8bd123ee1927648f1079c24 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/lt/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/nl/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/nl/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..4846bb5f9c16dc4db5b8c36d5b9b92b8e666ba9c Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/nl/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pl/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pl/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..e0e96e6dda0ac8f56b0b7a917eed2922e7354620 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pl/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pt_BR/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pt_BR/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..92028c56215bb8c164661b1406bf34449ca68f95 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/pt_BR/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/rm/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/rm/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..bf0d78c1a675a025e386c12156b10d4f416abd46 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/rm/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ro/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ro/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..d4f9bfa1279e2368aae76a618fbabc919161c0c3 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ro/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ru/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ru/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..ec0b7caf8c42d04f1cd9c257bc2d2c9ae0cf108d Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/ru/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sk/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sk/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..59a83dad7f25c2c5840ac870f1d55227b0d2e328 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sk/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sl/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sl/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..5f7c0f1e260c09d740d0f9a7c0f2fd3f943a0102 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sl/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sq/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sq/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..4d528dceced80f8fa3fd0e00122bfdd6ba87290f Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sq/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sr/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sr/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..9924b3508511f810a66d957cbbc8f70e6d798f39 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sr/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sv/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sv/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..c7c8c06c5dc87ab2dfee8737338b2e938c89c2a8 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/sv/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/tr/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/tr/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..6cc3bbc30cb60d436881365b9bdc925328bf929d Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/tr/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/uk/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/uk/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..bd2acaa31c316d64091d0bda8a32fb56b944d493 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/uk/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/vi/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/vi/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..090e29eb9d1708a6b06d3ce8f9f37e8e58ae797c Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/vi/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/wa/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/wa/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..c4bc26d32a35ebe5d6111160de81ec3b3220b6b8 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/wa/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_CN/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_CN/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..cc4c93606019d97a1cfa9ba970931f6c5a04ff07 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_CN/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_TW/LC_MESSAGES/libiconv.mo b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_TW/LC_MESSAGES/libiconv.mo new file mode 100644 index 0000000000000000000000000000000000000000..e63f4a938f0b569dc1460cb6470bbe8f86ee2e03 Binary files /dev/null and b/miniconda3/pkgs/libiconv-1.18-h75a1612_0/share/locale/zh_TW/LC_MESSAGES/libiconv.mo differ diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/bin/idn2 b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/bin/idn2 new file mode 100644 index 0000000000000000000000000000000000000000..187cb866b8a032b955b84dff848639afc89d721f Binary files /dev/null and b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/bin/idn2 differ diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/include/idn2.h b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/include/idn2.h new file mode 100644 index 0000000000000000000000000000000000000000..e3ebd1e0b216ce996fe0311e4ecd944e2eb54ad2 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/include/idn2.h @@ -0,0 +1,418 @@ +/* idn2.h - header file for idn2 + Copyright (C) 2011-2025 Simon Josefsson + + Libidn2 is free software: you can redistribute it and/or modify it + under the terms of either: + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at + your option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at + your option) any later version. + + or both in parallel, as here. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see . +*/ + +#ifndef IDN2_H +# define IDN2_H + +/** + * SECTION:idn2 + * @title: idn2.h + * @short_description: main library interfaces + * + * The main library interfaces are declared in idn2.h. + */ + +/* *INDENT-OFF* */ +/* see https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html */ +#ifndef _IDN2_API +# if defined IDN2_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY +# define _IDN2_API __attribute__((__visibility__("default"))) +# elif defined IDN2_BUILDING && defined _MSC_VER && ! defined IDN2_STATIC +# define _IDN2_API __declspec(dllexport) +# elif defined _MSC_VER && ! defined IDN2_STATIC +# define _IDN2_API __declspec(dllimport) +# else +# define _IDN2_API +# endif +#endif +/* *INDENT-ON* */ + +# include /* uint32_t */ +# include /* size_t */ + +# ifdef __cplusplus +extern "C" +{ +# endif + +/** + * GCC_VERSION_AT_LEAST + * @major: gcc major version number to compare with + * @minor: gcc minor version number to compare with + * + * Pre-processor symbol to check the gcc version. + */ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define GCC_VERSION_AT_LEAST(major, minor) ((__GNUC__ > (major)) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) +# else +# define GCC_VERSION_AT_LEAST(major, minor) 0 +# endif + +/* the following G_GNUC_ prefixes are for gtk-doc to recognize the attributes */ + +/** + * G_GNUC_IDN2_ATTRIBUTE_PURE + * + * Function attribute: Function is a pure function. + */ +# if GCC_VERSION_AT_LEAST(2,96) +# define G_GNUC_IDN2_ATTRIBUTE_PURE __attribute__ ((pure)) +# else +# define G_GNUC_IDN2_ATTRIBUTE_PURE +# endif + +/** + * G_GNUC_IDN2_ATTRIBUTE_CONST + * + * Function attribute: Function is a const function. + */ +# if GCC_VERSION_AT_LEAST(2,5) +# define G_GNUC_IDN2_ATTRIBUTE_CONST __attribute__ ((const)) +# else +# define G_GNUC_IDN2_ATTRIBUTE_CONST +# endif + +/** + * G_GNUC_UNUSED + * + * Parameter attribute: Parameter is not used. + */ +# if GCC_VERSION_AT_LEAST(2,95) +# define G_GNUC_UNUSED __attribute__ ((__unused__)) +# else +# define G_GNUC_UNUSED /* empty */ +# endif + + +/** + * IDN2_VERSION + * + * Pre-processor symbol with a string that describe the header file + * version number. Used together with idn2_check_version() to verify + * header file and run-time library consistency. + */ +# define IDN2_VERSION "2.3.8" + +/** + * IDN2_VERSION_NUMBER + * + * Pre-processor symbol with a hexadecimal value describing the header + * file version number. For example, when the header version is + * 1.2.4711 this symbol will have the value 0x01021267. The last four + * digits are used to enumerate development snapshots, but for all + * public releases they will be 0000. + */ +# define IDN2_VERSION_NUMBER 0x02030008 + +/** + * IDN2_VERSION_MAJOR + * + * Pre-processor symbol for the major version number (decimal). + * The version scheme is major.minor.patchlevel. + */ +# define IDN2_VERSION_MAJOR 2 + +/** + * IDN2_VERSION_MINOR + * + * Pre-processor symbol for the minor version number (decimal). + * The version scheme is major.minor.patchlevel. + */ +# define IDN2_VERSION_MINOR 3 + +/** + * IDN2_VERSION_PATCH + * + * Pre-processor symbol for the patch level number (decimal). + * The version scheme is major.minor.patchlevel. + */ +# define IDN2_VERSION_PATCH 8 + +/** + * IDN2_LABEL_MAX_LENGTH + * + * Constant specifying the maximum length of a DNS label to 63 + * characters, as specified in RFC 1034. + */ +# define IDN2_LABEL_MAX_LENGTH 63 + +/** + * IDN2_DOMAIN_MAX_LENGTH + * + * Constant specifying the maximum size of the wire encoding of a DNS + * domain to 255 characters, as specified in RFC 1034. Note that the + * usual printed representation of a domain name is limited to 253 + * characters if it does not end with a period, or 254 characters if + * it ends with a period. + */ +# define IDN2_DOMAIN_MAX_LENGTH 255 + +/** + * idn2_flags: + * @IDN2_NFC_INPUT: Normalize input string using normalization form C. + * @IDN2_ALABEL_ROUNDTRIP: Perform optional IDNA2008 lookup roundtrip check (default). + * @IDN2_NO_ALABEL_ROUNDTRIP: Disable ALabel lookup roundtrip check. + * @IDN2_NO_TR46: Disable Unicode TR46 processing. + * @IDN2_TRANSITIONAL: Perform Unicode TR46 transitional processing. + * @IDN2_NONTRANSITIONAL: Perform Unicode TR46 non-transitional processing (default). + * @IDN2_ALLOW_UNASSIGNED: Libidn compatibility flag, unused. + * @IDN2_USE_STD3_ASCII_RULES: Use STD3 ASCII rules. + * This is a Unicode TR46 only flag, and will be ignored when set without + * either @IDN2_TRANSITIONAL or @IDN2_NONTRANSITIONAL. + * + * Flags to IDNA2008 functions, to be binary or:ed together. Specify + * only 0 if you want the default behaviour. + */ + typedef enum + { + IDN2_NFC_INPUT = 1, + IDN2_ALABEL_ROUNDTRIP = 2, + IDN2_TRANSITIONAL = 4, + IDN2_NONTRANSITIONAL = 8, + IDN2_ALLOW_UNASSIGNED = 16, + IDN2_USE_STD3_ASCII_RULES = 32, + IDN2_NO_TR46 = 64, + IDN2_NO_ALABEL_ROUNDTRIP = 128 + } idn2_flags; + +/* IDNA2008 with UTF-8 encoded inputs. */ + + extern _IDN2_API int + idn2_lookup_u8 (const uint8_t * src, uint8_t ** lookupname, int flags); + + extern _IDN2_API int + idn2_register_u8 (const uint8_t * ulabel, const uint8_t * alabel, + uint8_t ** insertname, int flags); + +/* IDNA2008 with locale encoded inputs. */ + + extern _IDN2_API int + idn2_lookup_ul (const char *src, char **lookupname, int flags); + + extern _IDN2_API int + idn2_register_ul (const char *ulabel, const char *alabel, + char **insertname, int flags); + +/** + * idn2_rc: + * @IDN2_OK: Successful return. + * @IDN2_MALLOC: Memory allocation error. + * @IDN2_NO_CODESET: Could not determine locale string encoding format. + * @IDN2_ICONV_FAIL: Could not transcode locale string to UTF-8. + * @IDN2_ENCODING_ERROR: Unicode data encoding error. + * @IDN2_NFC: Error normalizing string. + * @IDN2_PUNYCODE_BAD_INPUT: Punycode invalid input. + * @IDN2_PUNYCODE_BIG_OUTPUT: Punycode output buffer too small. + * @IDN2_PUNYCODE_OVERFLOW: Punycode conversion would overflow. + * @IDN2_TOO_BIG_DOMAIN: Domain name longer than 255 characters. + * @IDN2_TOO_BIG_LABEL: Domain label longer than 63 characters. + * @IDN2_INVALID_ALABEL: Input A-label is not valid. + * @IDN2_UALABEL_MISMATCH: Input A-label and U-label does not match. + * @IDN2_INVALID_FLAGS: Invalid combination of flags. + * @IDN2_NOT_NFC: String is not NFC. + * @IDN2_2HYPHEN: String has forbidden two hyphens. + * @IDN2_HYPHEN_STARTEND: String has forbidden starting/ending hyphen. + * @IDN2_LEADING_COMBINING: String has forbidden leading combining character. + * @IDN2_DISALLOWED: String has disallowed character. + * @IDN2_CONTEXTJ: String has forbidden context-j character. + * @IDN2_CONTEXTJ_NO_RULE: String has context-j character with no rull. + * @IDN2_CONTEXTO: String has forbidden context-o character. + * @IDN2_CONTEXTO_NO_RULE: String has context-o character with no rull. + * @IDN2_UNASSIGNED: String has forbidden unassigned character. + * @IDN2_BIDI: String has forbidden bi-directional properties. + * @IDN2_DOT_IN_LABEL: Label has forbidden dot (TR46). + * @IDN2_INVALID_TRANSITIONAL: Label has character forbidden in transitional mode (TR46). + * @IDN2_INVALID_NONTRANSITIONAL: Label has character forbidden in non-transitional mode (TR46). + * @IDN2_ALABEL_ROUNDTRIP_FAILED: ALabel -> Ulabel -> ALabel result differs from input. + * + * Return codes for IDN2 functions. All return codes are negative + * except for the successful code IDN2_OK which are guaranteed to be + * 0. Positive values are reserved for non-error return codes. + * + * Note that the #idn2_rc enumeration may be extended at a later date + * to include new return codes. + */ + typedef enum + { + IDN2_OK = 0, + IDN2_MALLOC = -100, + IDN2_NO_CODESET = -101, + IDN2_ICONV_FAIL = -102, + IDN2_ENCODING_ERROR = -200, + IDN2_NFC = -201, + IDN2_PUNYCODE_BAD_INPUT = -202, + IDN2_PUNYCODE_BIG_OUTPUT = -203, + IDN2_PUNYCODE_OVERFLOW = -204, + IDN2_TOO_BIG_DOMAIN = -205, + IDN2_TOO_BIG_LABEL = -206, + IDN2_INVALID_ALABEL = -207, + IDN2_UALABEL_MISMATCH = -208, + IDN2_INVALID_FLAGS = -209, + IDN2_NOT_NFC = -300, + IDN2_2HYPHEN = -301, + IDN2_HYPHEN_STARTEND = -302, + IDN2_LEADING_COMBINING = -303, + IDN2_DISALLOWED = -304, + IDN2_CONTEXTJ = -305, + IDN2_CONTEXTJ_NO_RULE = -306, + IDN2_CONTEXTO = -307, + IDN2_CONTEXTO_NO_RULE = -308, + IDN2_UNASSIGNED = -309, + IDN2_BIDI = -310, + IDN2_DOT_IN_LABEL = -311, + IDN2_INVALID_TRANSITIONAL = -312, + IDN2_INVALID_NONTRANSITIONAL = -313, + IDN2_ALABEL_ROUNDTRIP_FAILED = -314, + } idn2_rc; + +/* Auxiliary functions. */ + + extern _IDN2_API int idn2_to_ascii_4i (const uint32_t * input, size_t inlen, + char *output, int flags); + extern _IDN2_API int idn2_to_ascii_4i2 (const uint32_t * input, + size_t inlen, char **output, + int flags); + extern _IDN2_API int idn2_to_ascii_4z (const uint32_t * input, + char **output, int flags); + extern _IDN2_API int idn2_to_ascii_8z (const char *input, char **output, + int flags); + extern _IDN2_API int idn2_to_ascii_lz (const char *input, char **output, + int flags); + + extern _IDN2_API int idn2_to_unicode_8z4z (const char *input, + uint32_t ** output, + int flags G_GNUC_UNUSED); + extern _IDN2_API int idn2_to_unicode_4z4z (const uint32_t * input, + uint32_t ** output, int flags); + extern _IDN2_API int idn2_to_unicode_44i (const uint32_t * in, size_t inlen, + uint32_t * out, size_t *outlen, + int flags); + extern _IDN2_API int idn2_to_unicode_8z8z (const char *input, char **output, + int flags); + extern _IDN2_API int idn2_to_unicode_8zlz (const char *input, char **output, + int flags); + extern _IDN2_API int idn2_to_unicode_lzlz (const char *input, char **output, + int flags); + + extern _IDN2_API int idn2_punycode_encode (const uint32_t * input, + size_t input_length, + char *output, + size_t *output_length); + extern _IDN2_API int idn2_punycode_decode (const char *input, + size_t input_length, + uint32_t * output, + size_t *output_length); + + extern _IDN2_API const char *idn2_strerror (int rc) + G_GNUC_IDN2_ATTRIBUTE_CONST; + extern _IDN2_API const char *idn2_strerror_name (int rc) + G_GNUC_IDN2_ATTRIBUTE_CONST; + + extern _IDN2_API const char *idn2_check_version (const char *req_version) + G_GNUC_IDN2_ATTRIBUTE_PURE; + + extern _IDN2_API void idn2_free (void *ptr); + +# ifndef __GTK_DOC_IGNORE__ +/*** libidn compatibility layer ***/ +# if !defined IDNA_H && !defined IDN2_SKIP_LIBIDN_COMPAT + +/** + * Idna_rc: + * @IDNA_SUCCESS: Same as %IDN2_OK + * @IDNA_STRINGPREP_ERROR: Same as %IDN2_ENCODING_ERROR + * @IDNA_PUNYCODE_ERROR: Same as %IDN2_PUNYCODE_BAD_INPUT + * @IDNA_CONTAINS_NON_LDH: Same as %IDN2_ENCODING_ERROR + * @IDNA_CONTAINS_LDH: Same as %IDNA_CONTAINS_NON_LDH + * @IDNA_CONTAINS_MINUS: Same as %IDN2_ENCODING_ERROR + * @IDNA_INVALID_LENGTH: Same as %IDN2_DISALLOWED + * @IDNA_NO_ACE_PREFIX: Same as %IDN2_ENCODING_ERROR + * @IDNA_ROUNDTRIP_VERIFY_ERROR: Same as %IDN2_ENCODING_ERROR + * @IDNA_CONTAINS_ACE_PREFIX: Same as %IDN2_ENCODING_ERROR + * @IDNA_ICONV_ERROR: Same as %IDN2_ENCODING_ERROR + * @IDNA_MALLOC_ERROR: Same as %IDN2_MALLOC + * @IDNA_DLOPEN_ERROR: Same as %IDN2_MALLOC + * + * Return codes for transition to / compatibility with libidn2. + * + * Please be aware that return codes from idna_ functions might be unexpected + * when linked / built with libidn2. + */ + typedef enum + { + IDNA_SUCCESS = IDN2_OK, + IDNA_STRINGPREP_ERROR = IDN2_ENCODING_ERROR, + IDNA_PUNYCODE_ERROR = IDN2_PUNYCODE_BAD_INPUT, + IDNA_CONTAINS_NON_LDH = IDN2_ENCODING_ERROR, + IDNA_CONTAINS_LDH = IDNA_CONTAINS_NON_LDH, + IDNA_CONTAINS_MINUS = IDN2_ENCODING_ERROR, + IDNA_INVALID_LENGTH = IDN2_DISALLOWED, + IDNA_NO_ACE_PREFIX = IDN2_ENCODING_ERROR, + IDNA_ROUNDTRIP_VERIFY_ERROR = IDN2_ENCODING_ERROR, + IDNA_CONTAINS_ACE_PREFIX = IDN2_ENCODING_ERROR, + IDNA_ICONV_ERROR = IDN2_ENCODING_ERROR, + IDNA_MALLOC_ERROR = IDN2_MALLOC, + IDNA_DLOPEN_ERROR = IDN2_MALLOC + } Idna_rc; + +/** + * Idna_flags: + * @IDNA_ALLOW_UNASSIGNED: Same as %IDN2_ALLOW_UNASSIGNED + * @IDNA_USE_STD3_ASCII_RULES: Same as %IDN2_USE_STD3_ASCII_RULES + * + * Flags for transition to / compatibility with libidn2. + */ + typedef enum + { + IDNA_ALLOW_UNASSIGNED = IDN2_ALLOW_UNASSIGNED, + IDNA_USE_STD3_ASCII_RULES = IDN2_USE_STD3_ASCII_RULES + } Idna_flags; + +# define idna_to_ascii_4i(i,l,o,f) idn2_to_ascii_4i(i,l,o,f|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL) +# define idna_to_ascii_4z(i,o,f) idn2_to_ascii_4z(i,o,f|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL) +# define idna_to_ascii_8z(i,o,f) idn2_to_ascii_8z(i,o,f|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL) +# define idna_to_ascii_lz(i,o,f) idn2_to_ascii_lz(i,o,f|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL) + +# define idna_to_unicode_8z4z idn2_to_unicode_8z4z +# define idna_to_unicode_4z4z idn2_to_unicode_4z4z +# define idna_to_unicode_44i idn2_to_unicode_44i +# define idna_to_unicode_8z8z idn2_to_unicode_8z8z +# define idna_to_unicode_8zlz idn2_to_unicode_8zlz +# define idna_to_unicode_lzlz idn2_to_unicode_lzlz + +# define idna_strerror idn2_strerror +# define idn_free idn2_free + +# endif /* IDNA_H */ +# endif + +# ifdef __cplusplus +} +# endif + +#endif /* IDN2_H */ diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/about.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..9a41c4f6150355d96f93837824ee553f7c89eb64 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/about.json @@ -0,0 +1,161 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "description": "Library for internationalized domain names (IDNA2008) support", + "dev_url": "https://gitlab.com/libidn/libidn2", + "doc_url": "https://libidn.gitlab.io/libidn2/manual/libidn2.html", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "hmaarrfk", + "chenghlee" + ] + }, + "home": "https://www.gnu.org/software/libidn/#libidn2", + "identifiers": [], + "keywords": [], + "license": "LGPL-2.0 AND LGPL-3.0-or-later AND GPL-3.0-or-later", + "license_family": "OTHER", + "license_file": "COPYING", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "Library for internationalized domain names (IDNA2008) support", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/files b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..8325643ca20d2c9b124b18cfccf0ab29ce4d0c18 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/files @@ -0,0 +1,6 @@ +bin/idn2 +include/idn2.h +lib/libidn2.so +lib/libidn2.so.0 +lib/libidn2.so.0.4.0 +lib/pkgconfig/libidn2.pc diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/git b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/has_prefix b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..8eb1199340ff2b024eb92b85543c7ec38a17f9bd --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/has_prefix @@ -0,0 +1 @@ +/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold text lib/pkgconfig/libidn2.pc diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/hash_input.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..e4f365a4db5fcff4e027f99be6137c80aff61e59 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/hash_input.json @@ -0,0 +1,11 @@ +{ + "target_platform": "linux-64", + "libiconv": "1", + "c_compiler": "gcc", + "c_compiler_version": "11.2.0", + "c_stdlib_version": "2.28", + "channel_targets": "defaults", + "c_stdlib": "sysroot", + "libidn2": "2", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/index.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..6a15166c6e398c4e6ce4f76cffde2d68eaff178d --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/index.json @@ -0,0 +1,19 @@ +{ + "arch": "x86_64", + "build": "hf80d704_0", + "build_number": 0, + "depends": [ + "__glibc >=2.28,<3.0.a0", + "gettext >=0.21.0,<1.0a0", + "libgcc-ng >=11.2.0", + "libiconv >=1.16,<2.0a0", + "libunistring >=1,<2.0a0" + ], + "license": "LGPL-2.0 AND LGPL-3.0-or-later AND GPL-3.0-or-later", + "license_family": "OTHER", + "name": "libidn2", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1760364378431, + "version": "2.3.8" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/licenses/COPYING b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/licenses/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..f288702d2fa16d3cdf0035b15a9fcbc552cd88e7 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/licenses/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/paths.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..245e4ca88ad77415cef99ae83509931481ee7954 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/paths.json @@ -0,0 +1,43 @@ +{ + "paths": [ + { + "_path": "bin/idn2", + "path_type": "hardlink", + "sha256": "8dad18c13017cac13ebf653f1e593cd1ec8f9837b37fab59257950ef798e3900", + "size_in_bytes": 32904 + }, + { + "_path": "include/idn2.h", + "path_type": "hardlink", + "sha256": "1f55fc1e02b0c4436c41ad7bb8977c64cf3bb61075a4cc412d996878fac93127", + "size_in_bytes": 14191 + }, + { + "_path": "lib/libidn2.so", + "path_type": "softlink", + "sha256": "22b858a36168b46b4eda136e6ff9806ee177d21db0911d11f26aab6420a4ddb2", + "size_in_bytes": 138688 + }, + { + "_path": "lib/libidn2.so.0", + "path_type": "softlink", + "sha256": "22b858a36168b46b4eda136e6ff9806ee177d21db0911d11f26aab6420a4ddb2", + "size_in_bytes": 138688 + }, + { + "_path": "lib/libidn2.so.0.4.0", + "path_type": "hardlink", + "sha256": "22b858a36168b46b4eda136e6ff9806ee177d21db0911d11f26aab6420a4ddb2", + "size_in_bytes": 138688 + }, + { + "_path": "lib/pkgconfig/libidn2.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold", + "sha256": "55ebabecb04b26ebde8963555c8b1bf97499f0a49504e38c8c7d1762927b2722", + "size_in_bytes": 1553 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/build.sh b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5b1570171bb4358ac12cec215c23e64dc34ec22 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -ex +set -o pipefail + +./configure --prefix="${PREFIX}" \ + CC_FOR_BUILD="${CC}" \ + --enable-shared \ + --disable-static \ + --disable-doc \ + --disable-gtk-doc \ + --disable-gtk-doc-html \ + --disable-gtk-doc-pdf \ + --disable-nls \ + --disable-code-coverage \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-gcov + +make +make check +make install + +# Save some space +rm -rf "${PREFIX}/share/info" +rm -rf "${PREFIX}/share/man" +rm -rf "${PREFIX}/share/gtk-doc" diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7c47fac8ab0c2bca8532d92c9583b2a32f87d053 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,33 @@ +c_compiler: gcc +c_compiler_version: 11.2.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +extend_keys: +- ignore_build_only_deps +- ignore_version +- pin_run_as_build +- extend_keys +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +libiconv: '1' +libidn2: '2' +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cc690728a3088cb2005cd0e4ff4ae9c4eb9f8c66 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml @@ -0,0 +1,76 @@ +# This file created by conda-build 25.1.2 +# meta.yaml template originally from: +# /home/task_176036377076491/libidn2-feedstock/recipe, last modified Mon Oct 13 14:04:48 2025 +# ------------------------------------------------ + +package: + name: libidn2 + version: 2.3.8 +source: + sha256: f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a + url: https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz +build: + number: '0' + run_exports: + - libidn2 >=2,<3.0a0 + string: hf80d704_0 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - binutils_impl_linux-64 2.40 h5293946_0 + - binutils_linux-64 2.40.0 hc2dff05_2 + - gcc_impl_linux-64 11.2.0 h1234567_1 + - gcc_linux-64 11.2.0 h5c386dc_2 + - gnuconfig 2021.05.24 hd3eb1b0_0 + - kernel-headers_linux-64 4.18.0 h528b178_0 + - ld_impl_linux-64 2.40 h12ee557_0 + - libgcc-devel_linux-64 11.2.0 h1234567_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libstdcxx-ng 11.2.0 h1234567_1 + - make 4.2.1 h1bed415_1 + - pkg-config 0.29.2 h1bed415_8 + - sysroot_linux-64 2.28 h528b178_0 + - tzdata 2025b h04d1e81_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - gettext 0.21.0 hedfda30_2 + - icu 73.1 h6a678d5_0 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libiconv 1.16 h5eee18b_3 + - libstdcxx-ng 11.2.0 h1234567_1 + - libunistring 1.3 hb25bd0a_0 + - libxml2 2.13.8 hfdd30dd_0 + - libzlib 1.3.1 hb25bd0a_0 + - ncurses 6.5 h7934f7d_0 + - xz 5.6.4 h5eee18b_1 + - zlib 1.3.1 hb25bd0a_0 + run: + - __glibc >=2.28,<3.0.a0 + - gettext >=0.21.0,<1.0a0 + - libgcc-ng >=11.2.0 + - libiconv >=1.16,<2.0a0 + - libunistring >=1,<2.0a0 +test: + commands: + - test -f "${PREFIX}/include/idn2.h" + - test -f "${PREFIX}/lib/libidn2${SHLIB_EXT}" + - test ! -f "${PREFIX}/lib/libidn2.a" +about: + description: Library for internationalized domain names (IDNA2008) support + dev_url: https://gitlab.com/libidn/libidn2 + doc_url: https://libidn.gitlab.io/libidn2/manual/libidn2.html + home: https://www.gnu.org/software/libidn/#libidn2 + license: LGPL-2.0 AND LGPL-3.0-or-later AND GPL-3.0-or-later + license_family: OTHER + license_file: COPYING + summary: Library for internationalized domain names (IDNA2008) support +extra: + copy_test_source_files: true + final: true + recipe-maintainers: + - chenghlee + - hmaarrfk diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml.template b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..7bc44c29d0768ab88ff376f2bfba23c4be82c10f --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/recipe/meta.yaml.template @@ -0,0 +1,53 @@ +{% set name = "libidn2" %} +{% set version = "2.3.8" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://ftp.gnu.org/gnu/libidn/libidn2-{{ version }}.tar.gz + sha256: f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a + +build: + skip: True # [win] + number: 0 + run_exports: + # _Amazing_ backwards compatibility so pin to major number: + # https://abi-laboratory.pro/tracker/timeline/libidn2/ + - {{ pin_subpackage('libidn2', min_pin='x', max_pin='x') }} + +requirements: + build: + - {{ stdlib('c') }} + - {{ compiler('c') }} + - make + - pkg-config + - gnuconfig # [unix] + host: + - gettext >=0.19.8 + - libunistring 1.3 + - libiconv + run: + - libiconv + +test: + commands: + - test -f "${PREFIX}/include/idn2.h" + - test -f "${PREFIX}/lib/libidn2${SHLIB_EXT}" + - test ! -f "${PREFIX}/lib/libidn2.a" + +about: + home: https://www.gnu.org/software/libidn/#libidn2 + license: LGPL-2.0 AND LGPL-3.0-or-later AND GPL-3.0-or-later + license_file: COPYING + license_family: OTHER + description: "Library for internationalized domain names (IDNA2008) support" + summary: "Library for internationalized domain names (IDNA2008) support" + dev_url: https://gitlab.com/libidn/libidn2 + doc_url: https://libidn.gitlab.io/libidn2/manual/libidn2.html + +extra: + recipe-maintainers: + - hmaarrfk + - chenghlee diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/repodata_record.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..6351efacadabe49da6360dbcbf81a397a375fdc6 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "hf80d704_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "gettext >=0.21.0,<1.0a0", + "libgcc-ng >=11.2.0", + "libiconv >=1.16,<2.0a0", + "libunistring >=1,<2.0a0" + ], + "fn": "libidn2-2.3.8-hf80d704_0.conda", + "license": "LGPL-2.0 AND LGPL-3.0-or-later AND GPL-3.0-or-later", + "license_family": "OTHER", + "md5": "7ab70b332bb2df9ce90a1567126b5d2a", + "name": "libidn2", + "platform": "linux", + "sha256": "675beb2f9d9c876b87601b043d7e9e3b87cbec6b2172453932602db74e0099d7", + "size": 82352, + "subdir": "linux-64", + "timestamp": 1760364378000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libidn2-2.3.8-hf80d704_0.conda", + "version": "2.3.8" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/run_exports.json b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..c3b93e715cbec9307e4a6634ed168745f8f4f156 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libidn2 >=2,<3.0a0"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/test/run_test.sh b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..acd96dec70094a50f13b2c3c17ad59046cd18680 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/info/test/run_test.sh @@ -0,0 +1,10 @@ + + +set -ex + + + +test -f "${PREFIX}/include/idn2.h" +test -f "${PREFIX}/lib/libidn2${SHLIB_EXT}" +test ! -f "${PREFIX}/lib/libidn2.a" +exit 0 diff --git a/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/lib/pkgconfig/libidn2.pc b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/lib/pkgconfig/libidn2.pc new file mode 100644 index 0000000000000000000000000000000000000000..25211dbddbab4e76e3ae6c234bef031d086b0590 --- /dev/null +++ b/miniconda3/pkgs/libidn2-2.3.8-hf80d704_0/lib/pkgconfig/libidn2.pc @@ -0,0 +1,11 @@ +prefix=/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: libidn2 +Description: Library implementing IDNA2008 and TR46 +Version: 2.3.8 +Cflags: -I${includedir} +Libs: -L${libdir} -lidn2 +Libs.private: -L/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib -liconv -R/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib -L/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib -lunistring -R/home/task_176036377076491/conda-bld/libidn2_1760364297213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/compile_et b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/compile_et new file mode 100644 index 0000000000000000000000000000000000000000..aa76a2e562aa0d543284278aaaaec565f693bbef --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/compile_et @@ -0,0 +1,36 @@ +#!/bin/sh +# +# +AWK=gawk +DIR=/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/share/et + +usage="usage: $0 [ -d scriptDir ] [ --textdomain domain [ --localedir dir ] ]" +usage="$usage inputfile.et" + +TEXTDOMAIN= +LOCALEDIR= + +while [ $# -ge 2 ]; do + if [ "$1" = "-d" ]; then + DIR=$2; shift; shift + elif [ "$1" = "--textdomain" ]; then + TEXTDOMAIN=$2; shift; shift + elif [ "$1" = "--localedir" ]; then + LOCALEDIR=$2; shift; shift + else + echo $usage 1>&2 ; exit 1 + fi +done + +# --localedir requires --textdomain. +if [ $# -ne 1 -o \( -n "$LOCALEDIR" -a -z "$TEXTDOMAIN" \) ]; then + echo $usage 1>&2 ; exit 1 +fi + +ROOT=`echo $1 | sed -e s/.et$//` +BASE=`echo "$ROOT" | sed -e 's;.*/;;'` + +set -ex +$AWK -f ${DIR}/et_h.awk "outfile=${BASE}.h" "$ROOT.et" +$AWK -f ${DIR}/et_c.awk "outfile=${BASE}.c" "textdomain=$TEXTDOMAIN" \ + "localedir=$LOCALEDIR" "$ROOT.et" diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/krb5-config b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/krb5-config new file mode 100644 index 0000000000000000000000000000000000000000..ae9b8ac6d349b80b9761beffa928849b506bea30 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/bin/krb5-config @@ -0,0 +1,260 @@ +#!/bin/sh + +# Copyright 2001, 2002, 2003 by the Massachusetts Institute of Technology. +# All Rights Reserved. +# +# Export of this software from the United States of America may +# require a specific license from the United States Government. +# It is the responsibility of any person or organization contemplating +# export to obtain such a license before exporting. +# +# WITHIN THAT CONSTRAINT, permission to use, copy, modify, and +# distribute this software and its documentation for any purpose and +# without fee is hereby granted, provided that the above copyright +# notice appear in all copies and that both that copyright notice and +# this permission notice appear in supporting documentation, and that +# the name of M.I.T. not be used in advertising or publicity pertaining +# to distribution of the software without specific, written prior +# permission. Furthermore if you modify this software you must label +# your software as modified software and not distribute it in such a +# fashion that it might be confused with the original M.I.T. software. +# M.I.T. makes no representations about the suitability of +# this software for any purpose. It is provided "as is" without express +# or implied warranty. +# +# + +# Configurable parameters set by autoconf +version_string="Kerberos 5 release 1.22.1" + +prefix=/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib +CC_LINK='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)' +KDB5_DB_LIB= +RPATH_FLAG='' +PROG_RPATH_FLAGS='' +PTHREAD_CFLAGS='-pthread' +DL_LIB='-ldl' +DEFCCNAME='FILE:/tmp/krb5cc_%{uid}' +DEFKTNAME='FILE:/etc/krb5.keytab' +DEFCKTNAME='FILE:/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/var/krb5/user/%{euid}/client.keytab' + +LIBS='-lcrypto -lresolv ' + +# Defaults for program +library=krb5 + +# Some constants +vendor_string="Massachusetts Institute of Technology" + +# Process arguments +# Yes, we are sloppy, library specifications can come before options +while test $# != 0; do + case $1 in + --all) + do_all=1 + ;; + --cflags) + do_cflags=1 + ;; + --defccname) + do_defccname=1 + ;; + --defcktname) + do_defcktname=1 + ;; + --defktname) + do_defktname=1 + ;; + --deps) # historically a no-op + ;; + --exec-prefix) + do_exec_prefix=1 + ;; + --help) + do_help=1 + ;; + --libs) + do_libs=1 + ;; + --prefix) + do_prefix=1 + ;; + --vendor) + do_vendor=1 + ;; + --version) + do_version=1 + ;; + krb5) + library=krb5 + ;; + gssapi) + library=gssapi + ;; + gssrpc) + library=gssrpc + ;; + kadm-client) + library=kadm_client + ;; + kadm-server) + library=kadm_server + ;; + kdb) + library=kdb + ;; + *) + echo "$0: Unknown option \`$1' -- use \`--help' for usage" + exit 1 + esac + shift +done + +# If required options - provide help +if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a \ + -z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a \ + -z "$do_defccname" -a -z "$do_defktname" -a -z "$do_defcktname" -a \ + -z "$do_cflags" -a -z "$do_libs"; then + do_help=1 +fi + + +if test -n "$do_help"; then + echo "Usage: $0 [OPTIONS] [LIBRARIES]" + echo "Options:" + echo " [--help] Help" + echo " [--all] Display version, vendor, and various values" + echo " [--version] Version information" + echo " [--vendor] Vendor information" + echo " [--prefix] Kerberos installed prefix" + echo " [--exec-prefix] Kerberos installed exec_prefix" + echo " [--defccname] Show built-in default ccache name" + echo " [--defktname] Show built-in default keytab name" + echo " [--defcktname] Show built-in default client keytab name" + echo " [--cflags] Compile time CFLAGS" + echo " [--libs] List libraries required to link [LIBRARIES]" + echo "Libraries:" + echo " krb5 Kerberos 5 application" + echo " gssapi GSSAPI application with Kerberos 5 bindings" + echo " gssrpc GSSAPI RPC application" + echo " kadm-client Kadmin client" + echo " kadm-server Kadmin server" + echo " kdb Application that accesses the kerberos database" + exit 0 +fi + +if test -n "$do_all"; then + all_exit= + do_version=1 + do_prefix=1 + do_exec_prefix=1 + do_vendor=1 + title_version="Version: " + title_prefix="Prefix: " + title_exec_prefix="Exec_prefix: " + title_vendor="Vendor: " +else + all_exit="exit 0" +fi + +if test -n "$do_version"; then + echo "$title_version$version_string" + $all_exit +fi + +if test -n "$do_vendor"; then + echo "$title_vendor$vendor_string" + $all_exit +fi + +if test -n "$do_prefix"; then + echo "$title_prefix$prefix" + $all_exit +fi + +if test -n "$do_exec_prefix"; then + echo "$title_exec_prefix$exec_prefix" + $all_exit +fi + +if test -n "$do_defccname"; then + echo "$DEFCCNAME" + $all_exit +fi + +if test -n "$do_defktname"; then + echo "$DEFKTNAME" + $all_exit +fi + +if test -n "$do_defcktname"; then + echo "$DEFCKTNAME" + $all_exit +fi + +if test -n "$do_cflags"; then + if test x"$includedir" != x"/usr/include" ; then + echo "-I${includedir}" + else + echo '' + fi +fi + + +if test -n "$do_libs"; then + # Assumes /usr/lib is the standard library directory everywhere... + if test "$libdir" = /usr/lib; then + libdirarg= + else + libdirarg="-L$libdir" + fi + # Ugly gross hack for our build tree + lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \ + -e 's/\$(PURE)//' \ + -e 's#\$(PROG_RPATH_FLAGS)#'"$PROG_RPATH_FLAGS"'#' \ + -e 's#\$(PROG_RPATH)#'$libdir'#' \ + -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \ + -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \ + -e 's#\$(LDFLAGS)##' \ + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ + -e 's#\$(CFLAGS)##'` + + if test $library = 'kdb'; then + lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB" + library=krb5 + fi + + if test $library = 'kadm_server'; then + lib_flags="$lib_flags -lkadm5srv_mit -lkdb5 $KDB5_DB_LIB" + library=gssrpc + fi + + if test $library = 'kadm_client'; then + lib_flags="$lib_flags -lkadm5clnt_mit" + library=gssrpc + fi + + if test $library = 'gssrpc'; then + lib_flags="$lib_flags -lgssrpc" + library=gssapi + fi + + if test $library = 'gssapi'; then + lib_flags="$lib_flags -lgssapi_krb5" + library=krb5 + fi + + if test $library = 'krb5'; then + lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err" + fi + + # If we ever support a flag to generate output suitable for static + # linking, we would output "-lkrb5support $LIBS $DL_LIB" here. + + echo $lib_flags +fi + +exit 0 diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/com_err.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/com_err.h new file mode 100644 index 0000000000000000000000000000000000000000..0a631e981ebc678a3dd42927eab462506d2f81c6 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/com_err.h @@ -0,0 +1,80 @@ +/* + * Copyright 1988, Student Information Processing Board of the + * Massachusetts Institute of Technology. + * + * Copyright 1995 by Cygnus Support. + * + * For copyright and distribution info, see the documentation supplied + * with this package. + */ + +/* Header file for common error description library. */ + +#ifndef __COM_ERR_H + +#if defined(_WIN32) +#include +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#include + +typedef long errcode_t; +typedef void (*et_old_error_hook_func) (const char *, errcode_t, + const char *, va_list ap); + +struct error_table { + /*@shared@*/ char const * const * msgs; + long base; + unsigned int n_msgs; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public interfaces */ +extern void KRB5_CALLCONV_C com_err + (const char *, errcode_t, const char *, ...) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 4))) +#endif + ; +extern void KRB5_CALLCONV com_err_va + (const char *whoami, errcode_t code, const char *fmt, + va_list ap) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 0))) +#endif + ; +extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message + (errcode_t) + /*@modifies internalState@*/; +extern errcode_t KRB5_CALLCONV add_error_table + (/*@dependent@*/ const struct error_table *) + /*@modifies internalState@*/; +extern errcode_t KRB5_CALLCONV remove_error_table + (const struct error_table *) + /*@modifies internalState@*/; + +#if !defined(_WIN32) +/* + * The display routine should be application specific. A global hook, + * may cause inappropriate display procedures to be called between + * applications under non-Unix environments. + */ + +extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); +extern et_old_error_hook_func reset_com_err_hook (void); +#endif + +#ifdef __cplusplus +} +#endif + +#define __COM_ERR_H +#endif /* ! defined(__COM_ERR_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi.h new file mode 100644 index 0000000000000000000000000000000000000000..9383dabdc0d06b8d955d9f324fb179459cbbebac --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi.h @@ -0,0 +1,6 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Wrapper so that #include will work without special include + * paths. + */ +#include diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi.h new file mode 100644 index 0000000000000000000000000000000000000000..60e858ba855833bc2effa24eabb19bbe50aeb316 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi.h @@ -0,0 +1,923 @@ +/* This is the gssapi.h prologue. */ +/* no xom.h */ +/* End of gssapi.h prologue. */ +/* -*- mode: c; indent-tabs-mode: nil -*- */ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_H_ +#define _GSSAPI_H_ + +/* + * Determine platform-dependent configuration. + */ + +#if defined(__MACH__) && defined(__APPLE__) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__)) +#pragma pack(push,2) +#endif + +#if defined(_MSDOS) || defined(_WIN32) +#include +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#include + +/* + * First, include stddef.h to get size_t defined. + */ +#include + +/* + * POSIX says that sys/types.h is where size_t is defined. + */ +#include + +/* + * $Id$ + */ + +/* + * First, define the three platform-dependent pointer types. + */ + +struct gss_name_struct; +typedef struct gss_name_struct * gss_name_t; + +struct gss_cred_id_struct; +typedef struct gss_cred_id_struct * gss_cred_id_t; + +struct gss_ctx_id_struct; +typedef struct gss_ctx_id_struct * gss_ctx_id_t; + +/* + * The following type must be defined as the smallest natural unsigned integer + * supported by the platform that has at least 32 bits of precision. + */ +typedef uint32_t gss_uint32; +typedef int32_t gss_int32; + +#ifdef OM_STRING +/* + * We have included the xom.h header file. Use the definition for + * OM_object identifier. + */ +typedef OM_object_identifier gss_OID_desc, *gss_OID; +#else /* OM_STRING */ +/* + * We can't use X/Open definitions, so roll our own. + */ +typedef gss_uint32 OM_uint32; + +typedef struct gss_OID_desc_struct { + OM_uint32 length; + void *elements; +} gss_OID_desc, *gss_OID; +#endif /* OM_STRING */ + +typedef struct gss_OID_set_desc_struct { + size_t count; + gss_OID elements; +} gss_OID_set_desc, *gss_OID_set; + +typedef struct gss_buffer_desc_struct { + size_t length; + void *value; +} gss_buffer_desc, *gss_buffer_t; + +typedef struct gss_channel_bindings_struct { + OM_uint32 initiator_addrtype; + gss_buffer_desc initiator_address; + OM_uint32 acceptor_addrtype; + gss_buffer_desc acceptor_address; + gss_buffer_desc application_data; +} *gss_channel_bindings_t; + +/* + * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing + * discussions). + */ +typedef OM_uint32 gss_qop_t; +typedef int gss_cred_usage_t; + +/* + * Flag bits for context-level services. + */ +#define GSS_C_DELEG_FLAG 1 +#define GSS_C_MUTUAL_FLAG 2 +#define GSS_C_REPLAY_FLAG 4 +#define GSS_C_SEQUENCE_FLAG 8 +#define GSS_C_CONF_FLAG 16 +#define GSS_C_INTEG_FLAG 32 +#define GSS_C_ANON_FLAG 64 +#define GSS_C_PROT_READY_FLAG 128 +#define GSS_C_TRANS_FLAG 256 +#define GSS_C_DELEG_POLICY_FLAG 32768 + +/* + * Credential usage options + */ +#define GSS_C_BOTH 0 +#define GSS_C_INITIATE 1 +#define GSS_C_ACCEPT 2 + +/* + * Status code types for gss_display_status + */ +#define GSS_C_GSS_CODE 1 +#define GSS_C_MECH_CODE 2 + +/* + * The constant definitions for channel-bindings address families + */ +#define GSS_C_AF_UNSPEC 0 +#define GSS_C_AF_LOCAL 1 +#define GSS_C_AF_INET 2 +#define GSS_C_AF_IMPLINK 3 +#define GSS_C_AF_PUP 4 +#define GSS_C_AF_CHAOS 5 +#define GSS_C_AF_NS 6 +#define GSS_C_AF_NBS 7 +#define GSS_C_AF_ECMA 8 +#define GSS_C_AF_DATAKIT 9 +#define GSS_C_AF_CCITT 10 +#define GSS_C_AF_SNA 11 +#define GSS_C_AF_DECnet 12 +#define GSS_C_AF_DLI 13 +#define GSS_C_AF_LAT 14 +#define GSS_C_AF_HYLINK 15 +#define GSS_C_AF_APPLETALK 16 +#define GSS_C_AF_BSC 17 +#define GSS_C_AF_DSS 18 +#define GSS_C_AF_OSI 19 +#define GSS_C_AF_NETBIOS 20 +#define GSS_C_AF_X25 21 + +#define GSS_C_AF_NULLADDR 255 + +/* + * Various Null values. + */ +#define GSS_C_NO_NAME ((gss_name_t) 0) +#define GSS_C_NO_BUFFER ((gss_buffer_t) 0) +#define GSS_C_NO_OID ((gss_OID) 0) +#define GSS_C_NO_OID_SET ((gss_OID_set) 0) +#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0) +#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0) +#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0) +#define GSS_C_EMPTY_BUFFER {0, NULL} + +/* + * Some alternate names for a couple of the above values. These are defined + * for V1 compatibility. + */ +#define GSS_C_NULL_OID GSS_C_NO_OID +#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET + +/* + * Define the default Quality of Protection for per-message services. Note + * that an implementation that offers multiple levels of QOP may either reserve + * a value (for example zero, as assumed here) to mean "default protection", or + * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit + * QOP value. However a value of 0 should always be interpreted by a GSSAPI + * implementation as a request for the default protection level. + */ +#define GSS_C_QOP_DEFAULT 0 + +/* + * Expiration time of 2^32-1 seconds means infinite lifetime for a + * credential or security context + */ +#define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful) + + +/* Major status codes */ + +#define GSS_S_COMPLETE 0 + +/* + * Some "helper" definitions to make the status code macros obvious. + */ +#define GSS_C_CALLING_ERROR_OFFSET 24 +#define GSS_C_ROUTINE_ERROR_OFFSET 16 +#define GSS_C_SUPPLEMENTARY_OFFSET 0 +#define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul) +#define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul) +#define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul) + +/* + * The macros that test status codes for error conditions. Note that the + * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now + * evaluates its argument only once. + */ +#define GSS_CALLING_ERROR(x) \ + ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET)) +#define GSS_ROUTINE_ERROR(x) \ + ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)) +#define GSS_SUPPLEMENTARY_INFO(x) \ + ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET)) +#define GSS_ERROR(x) \ + ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \ + (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))) + +/* + * Now the actual status code definitions + */ + +/* + * Calling errors: + */ +#define GSS_S_CALL_INACCESSIBLE_READ \ + (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET) +#define GSS_S_CALL_INACCESSIBLE_WRITE \ + (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET) +#define GSS_S_CALL_BAD_STRUCTURE \ + (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET) + +/* + * Routine errors: + */ +#define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_MIC GSS_S_BAD_SIG +#define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DEFECTIVE_CREDENTIAL \ + (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_CREDENTIALS_EXPIRED \ + (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_CONTEXT_EXPIRED \ + (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DUPLICATE_ELEMENT \ + (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_NAME_NOT_MN \ + (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_MECH_ATTR \ + (((OM_uint32) 19ul) << GSS_C_ROUTINE_ERROR_OFFSET) + +/* + * Supplementary info bits: + */ +#define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0)) +#define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1)) +#define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2)) +#define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3)) +#define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4)) + + +/* + * Finally, function prototypes for the GSSAPI routines. + */ + +#if defined (_WIN32) && defined (_MSC_VER) +# ifdef GSS_DLL_FILE +# define GSS_DLLIMP __declspec(dllexport) +# else +# define GSS_DLLIMP __declspec(dllimport) +# endif +#else +# define GSS_DLLIMP +#endif + +/* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744. + * + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant + * GSS_C_NT_USER_NAME should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}. + * The constant GSS_C_NT_MACHINE_UID_NAME should be + * initialized to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) string_uid_name(3)}. + * The constant GSS_C_NT_STRING_UID_NAME should be + * initialized to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\x01\x05\x06\x02"}, + * corresponding to an object-identifier value of + * {iso(1) org(3) dod(6) internet(1) security(5) + * nametypes(6) gss-host-based-services(2)). The constant + * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point + * to that gss_OID_desc. This is a deprecated OID value, and + * implementations wishing to support hostbased-service names + * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID, + * defined below, to identify such names; + * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym + * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input + * parameter, but should not be emitted by GSS-API + * implementations + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" + * "\x01\x02\x01\x04"}, corresponding to an + * object-identifier value of {iso(1) member-body(2) + * Unites States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) service_name(4)}. The constant + * GSS_C_NT_HOSTBASED_SERVICE should be initialized + * to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\01\x05\x06\x03"}, + * corresponding to an object identifier value of + * {1(iso), 3(org), 6(dod), 1(internet), 5(security), + * 6(nametypes), 3(gss-anonymous-name)}. The constant + * and GSS_C_NT_ANONYMOUS should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS; + + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\x01\x05\x06\x04"}, + * corresponding to an object-identifier value of + * {1(iso), 3(org), 6(dod), 1(internet), 5(security), + * 6(nametypes), 4(gss-api-exported-name)}. The constant + * GSS_C_NT_EXPORT_NAME should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME; + +/* Function Prototypes */ + +OM_uint32 KRB5_CALLCONV +gss_acquire_cred( + OM_uint32 *, /* minor_status */ + gss_name_t, /* desired_name */ + OM_uint32, /* time_req */ + gss_OID_set, /* desired_mechs */ + gss_cred_usage_t, /* cred_usage */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *); /* time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_release_cred( + OM_uint32 *, /* minor_status */ + gss_cred_id_t *); /* cred_handle */ + +OM_uint32 KRB5_CALLCONV +gss_init_sec_context( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* claimant_cred_handle */ + gss_ctx_id_t *, /* context_handle */ + gss_name_t, /* target_name */ + gss_OID, /* mech_type (used to be const) */ + OM_uint32, /* req_flags */ + OM_uint32, /* time_req */ + gss_channel_bindings_t, /* input_chan_bindings */ + gss_buffer_t, /* input_token */ + gss_OID *, /* actual_mech_type */ + gss_buffer_t, /* output_token */ + OM_uint32 *, /* ret_flags */ + OM_uint32 *); /* time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_accept_sec_context( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_cred_id_t, /* acceptor_cred_handle */ + gss_buffer_t, /* input_token_buffer */ + gss_channel_bindings_t, /* input_chan_bindings */ + gss_name_t *, /* src_name */ + gss_OID *, /* mech_type */ + gss_buffer_t, /* output_token */ + OM_uint32 *, /* ret_flags */ + OM_uint32 *, /* time_rec */ + gss_cred_id_t *); /* delegated_cred_handle */ + +OM_uint32 KRB5_CALLCONV +gss_process_context_token( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t); /* token_buffer */ + + +OM_uint32 KRB5_CALLCONV +gss_delete_sec_context( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_buffer_t); /* output_token */ + + +OM_uint32 KRB5_CALLCONV +gss_context_time( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + OM_uint32 *); /* time_rec */ + + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_get_mic( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_qop_t, /* qop_req */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t); /* message_token */ + + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_verify_mic(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t, /* message_token */ + gss_qop_t * /* qop_state */ +); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_wrap( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + gss_buffer_t, /* input_message_buffer */ + int *, /* conf_state */ + gss_buffer_t); /* output_message_buffer */ + + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_unwrap( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* input_message_buffer */ + gss_buffer_t, /* output_message_buffer */ + int *, /* conf_state */ + gss_qop_t *); /* qop_state */ + + +OM_uint32 KRB5_CALLCONV +gss_display_status( + OM_uint32 *, /* minor_status */ + OM_uint32, /* status_value */ + int, /* status_type */ + gss_OID, /* mech_type (used to be const) */ + OM_uint32 *, /* message_context */ + gss_buffer_t); /* status_string */ + + +OM_uint32 KRB5_CALLCONV +gss_indicate_mechs( + OM_uint32 *, /* minor_status */ + gss_OID_set *); /* mech_set */ + + +OM_uint32 KRB5_CALLCONV +gss_compare_name( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name1 */ + gss_name_t, /* name2 */ + int *); /* name_equal */ + + +OM_uint32 KRB5_CALLCONV +gss_display_name( + OM_uint32 *, /* minor_status */ + gss_name_t, /* input_name */ + gss_buffer_t, /* output_name_buffer */ + gss_OID *); /* output_name_type */ + + +OM_uint32 KRB5_CALLCONV +gss_import_name( + OM_uint32 *, /* minor_status */ + gss_buffer_t, /* input_name_buffer */ + gss_OID, /* input_name_type(used to be const) */ + gss_name_t *); /* output_name */ + +OM_uint32 KRB5_CALLCONV +gss_release_name( + OM_uint32 *, /* minor_status */ + gss_name_t *); /* input_name */ + +OM_uint32 KRB5_CALLCONV +gss_release_buffer( + OM_uint32 *, /* minor_status */ + gss_buffer_t); /* buffer */ + +OM_uint32 KRB5_CALLCONV +gss_release_oid_set( + OM_uint32 *, /* minor_status */ + gss_OID_set *); /* set */ + +OM_uint32 KRB5_CALLCONV +gss_inquire_cred( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* cred_handle */ + gss_name_t *, /* name */ + OM_uint32 *, /* lifetime */ + gss_cred_usage_t *, /* cred_usage */ + gss_OID_set *); /* mechanisms */ + +/* Last argument new for V2 */ +OM_uint32 KRB5_CALLCONV +gss_inquire_context( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_name_t *, /* src_name */ + gss_name_t *, /* targ_name */ + OM_uint32 *, /* lifetime_rec */ + gss_OID *, /* mech_type */ + OM_uint32 *, /* ctx_flags */ + int *, /* locally_initiated */ + int *); /* open */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_wrap_size_limit( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + OM_uint32, /* req_output_size */ + OM_uint32 *); /* max_input_size */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_import_name_object( + OM_uint32 *, /* minor_status */ + void *, /* input_name */ + gss_OID, /* input_name_type */ + gss_name_t *); /* output_name */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_export_name_object( + OM_uint32 *, /* minor_status */ + gss_name_t, /* input_name */ + gss_OID, /* desired_name_type */ + void **); /* output_name */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_add_cred( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* input_cred_handle */ + gss_name_t, /* desired_name */ + gss_OID, /* desired_mech */ + gss_cred_usage_t, /* cred_usage */ + OM_uint32, /* initiator_time_req */ + OM_uint32, /* acceptor_time_req */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *, /* initiator_time_rec */ + OM_uint32 *); /* acceptor_time_rec */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_inquire_cred_by_mech( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* cred_handle */ + gss_OID, /* mech_type */ + gss_name_t *, /* name */ + OM_uint32 *, /* initiator_lifetime */ + OM_uint32 *, /* acceptor_lifetime */ + gss_cred_usage_t *); /* cred_usage */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_export_sec_context( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_buffer_t); /* interprocess_token */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_import_sec_context( + OM_uint32 *, /* minor_status */ + gss_buffer_t, /* interprocess_token */ + gss_ctx_id_t *); /* context_handle */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_release_oid( + OM_uint32 *, /* minor_status */ + gss_OID *); /* oid */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_create_empty_oid_set( + OM_uint32 *, /* minor_status */ + gss_OID_set *); /* oid_set */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_add_oid_set_member( + OM_uint32 *, /* minor_status */ + gss_OID, /* member_oid */ + gss_OID_set *); /* oid_set */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_test_oid_set_member( + OM_uint32 *, /* minor_status */ + gss_OID, /* member */ + gss_OID_set, /* set */ + int *); /* present */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_str_to_oid( + OM_uint32 *, /* minor_status */ + gss_buffer_t, /* oid_str */ + gss_OID *); /* oid */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_oid_to_str( + OM_uint32 *, /* minor_status */ + gss_OID, /* oid */ + gss_buffer_t); /* oid_str */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_inquire_names_for_mech( + OM_uint32 *, /* minor_status */ + gss_OID, /* mechanism */ + gss_OID_set *); /* name_types */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_inquire_mechs_for_name( + OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + gss_OID_set *); /* mech_types */ + +/* + * The following routines are obsolete variants of gss_get_mic, gss_wrap, + * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2 + * implementations for backwards compatibility with V1 applications. Distinct + * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI + * V1 applications to link against GSSAPI V2 implementations. + */ +OM_uint32 KRB5_CALLCONV +gss_sign( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* qop_req */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t); /* message_token */ + +OM_uint32 KRB5_CALLCONV +gss_verify( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t, /* token_buffer */ + int *); /* qop_state */ + +OM_uint32 KRB5_CALLCONV +gss_seal( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + int, /* qop_req */ + gss_buffer_t, /* input_message_buffer */ + int *, /* conf_state */ + gss_buffer_t); /* output_message_buffer */ + +OM_uint32 KRB5_CALLCONV +gss_unseal( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* input_message_buffer */ + gss_buffer_t, /* output_message_buffer */ + int *, /* conf_state */ + int *); /* qop_state */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_export_name( + OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + gss_buffer_t); /* exported_name */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_duplicate_name( + OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + gss_name_t *); /* dest_name */ + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV +gss_canonicalize_name( + OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + const gss_OID, /* mech_type */ + gss_name_t *); /* output_name */ + +/* RFC 4401 */ + +#define GSS_C_PRF_KEY_FULL 0 +#define GSS_C_PRF_KEY_PARTIAL 1 + +OM_uint32 KRB5_CALLCONV +gss_pseudo_random( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context */ + int, /* prf_key */ + const gss_buffer_t, /* prf_in */ + ssize_t, /* desired_output_len */ + gss_buffer_t); /* prf_out */ + +OM_uint32 KRB5_CALLCONV +gss_store_cred( + OM_uint32 *, /* minor_status */ + const gss_cred_id_t,/* input_cred_handle */ + gss_cred_usage_t, /* input_usage */ + const gss_OID, /* desired_mech */ + OM_uint32, /* overwrite_cred */ + OM_uint32, /* default_cred */ + gss_OID_set *, /* elements_stored */ + gss_cred_usage_t *);/* cred_usage_stored */ + +OM_uint32 KRB5_CALLCONV +gss_set_neg_mechs( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* cred_handle */ + const gss_OID_set); /* mech_set */ + +#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__)) +#pragma pack(pop) +#endif + +#ifdef __cplusplus +} +#endif + +/* XXXX these are not part of the GSSAPI C bindings! (but should be) */ + +#define GSS_CALLING_ERROR_FIELD(x) \ + (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK) +#define GSS_ROUTINE_ERROR_FIELD(x) \ + (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK) +#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \ + (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK) + +/* XXXX This is a necessary evil until the spec is fixed */ +#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE + +/* + * RFC 5587 + */ +typedef const gss_buffer_desc *gss_const_buffer_t; +typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t; +typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t; +typedef const struct gss_cred_id_struct *gss_const_cred_id_t; +typedef const struct gss_name_struct *gss_const_name_t; +typedef const gss_OID_desc *gss_const_OID; +typedef const gss_OID_set_desc *gss_const_OID_set; + +OM_uint32 KRB5_CALLCONV +gss_indicate_mechs_by_attrs( + OM_uint32 *, /* minor_status */ + gss_const_OID_set, /* desired_mech_attrs */ + gss_const_OID_set, /* except_mech_attrs */ + gss_const_OID_set, /* critical_mech_attrs */ + gss_OID_set *); /* mechs */ + +OM_uint32 KRB5_CALLCONV +gss_inquire_attrs_for_mech( + OM_uint32 *, /* minor_status */ + gss_const_OID, /* mech */ + gss_OID_set *, /* mech_attrs */ + gss_OID_set *); /* known_mech_attrs */ + +OM_uint32 KRB5_CALLCONV +gss_display_mech_attr( + OM_uint32 *, /* minor_status */ + gss_const_OID, /* mech_attr */ + gss_buffer_t, /* name */ + gss_buffer_t, /* short_desc */ + gss_buffer_t); /* long_desc */ + +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_CONCRETE; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_PSEUDO; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_COMPOSITE; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_NEGO; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_GLUE; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_MECH; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_DEPRECATED; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_DFLT_MECH; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_ITOK_FRAMED; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_INIT; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_INIT; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_ANON; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_ANON; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_DELEG_CRED; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_INTEG_PROT; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_CONF_PROT; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_MIC; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_WRAP; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_PROT_READY; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_REPLAY_DET; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_OOS_DET; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_CBINDINGS; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_PFS; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_COMPRESS; +GSS_DLLIMP extern gss_const_OID GSS_C_MA_CTX_TRANS; + +/* + * RFC 5801 + */ +OM_uint32 KRB5_CALLCONV +gss_inquire_saslname_for_mech( + OM_uint32 *, /* minor_status */ + const gss_OID, /* desired_mech */ + gss_buffer_t, /* sasl_mech_name */ + gss_buffer_t, /* mech_name */ + gss_buffer_t /* mech_description */ +); + +OM_uint32 KRB5_CALLCONV +gss_inquire_mech_for_saslname( + OM_uint32 *, /* minor_status */ + const gss_buffer_t, /* sasl_mech_name */ + gss_OID * /* mech_type */ +); + +#endif /* _GSSAPI_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_alloc.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_alloc.h new file mode 100644 index 0000000000000000000000000000000000000000..89ef3324f0ac5a51666195f39eeb1f86e0b86308 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_alloc.h @@ -0,0 +1,131 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* To the extent possible under law, Painless Security, LLC has waived + * all copyright and related or neighboring rights to GSS-API Memory + * Management Header. This work is published from: United States. + */ + +#ifndef GSSAPI_ALLOC_H +#define GSSAPI_ALLOC_H + +#ifdef _WIN32 +#include "winbase.h" +#endif +#include + +#if defined(_WIN32) + +static inline void +gssalloc_free(void *value) +{ + if (value) + HeapFree(GetProcessHeap(), 0, value); +} + +static inline void * +gssalloc_malloc(size_t size) +{ + return HeapAlloc(GetProcessHeap(), 0, size); +} + +static inline void * +gssalloc_calloc(size_t count, size_t size) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size); +} + +static inline void * +gssalloc_realloc(void *value, size_t size) +{ + /* Unlike realloc(), HeapReAlloc() does not work on null values. */ + if (value == NULL) + return HeapAlloc(GetProcessHeap(), 0, size); + return HeapReAlloc(GetProcessHeap(), 0, value, size); +} + +#elif defined(DEBUG_GSSALLOC) + +/* Be deliberately incompatible with malloc and free, to allow us to detect + * mismatched malloc/gssalloc usage on Unix. */ + +static inline void +gssalloc_free(void *value) +{ + char *p = (char *)value - 8; + + if (value == NULL) + return; + if (memcmp(p, "gssalloc", 8) != 0) + abort(); + free(p); +} + +static inline void * +gssalloc_malloc(size_t size) +{ + char *p = calloc(size + 8, 1); + + memcpy(p, "gssalloc", 8); + return p + 8; +} + +static inline void * +gssalloc_calloc(size_t count, size_t size) +{ + return gssalloc_malloc(count * size); +} + +static inline void * +gssalloc_realloc(void *value, size_t size) +{ + char *p = (char *)value - 8; + + if (value == NULL) + return gssalloc_malloc(size); + if (memcmp(p, "gssalloc", 8) != 0) + abort(); + return (char *)realloc(p, size + 8) + 8; +} + +#else /* not _WIN32 or DEBUG_GSSALLOC */ + +/* Normal Unix case, just use free/malloc/calloc/realloc. */ + +static inline void +gssalloc_free(void *value) +{ + free(value); +} + +static inline void * +gssalloc_malloc(size_t size) +{ + return malloc(size); +} + +static inline void * +gssalloc_calloc(size_t count, size_t size) +{ + return calloc(count, size); +} + +static inline void * +gssalloc_realloc(void *value, size_t size) +{ + return realloc(value, size); +} + +#endif /* not _WIN32 or DEBUG_GSSALLOC */ + +static inline char * +gssalloc_strdup(const char *str) +{ + size_t size = strlen(str)+1; + char *copy = gssalloc_malloc(size); + if (copy) { + memcpy(copy, str, size); + copy[size-1] = '\0'; + } + return copy; +} + +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_ext.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..38e396161b22a3ce80cb92d360a9d8b4b485c780 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_ext.h @@ -0,0 +1,650 @@ +/* + * Copyright 2008 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef GSSAPI_EXT_H_ +#define GSSAPI_EXT_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Solaris extensions + */ +#ifndef _WIN32 +OM_uint32 KRB5_CALLCONV +gss_pname_to_uid + (OM_uint32 *minor, + const gss_name_t name, + const gss_OID mech_type, + uid_t *uidOut); +#endif + +/** + * Provides a platform-specific name for a GSSAPI name as interpreted by a + * given mechanism. + * + * @param [out] minor Minor status code + * @param [in] name The gss name resulting from accept_sec_context + * @param [in] mech_type The mechanism that will be asked to map @a name to a + * local name + * @param [out] localname Caller-allocated buffer to be filled in with the + * local name on success + */ +OM_uint32 KRB5_CALLCONV +gss_localname + (OM_uint32 *minor, + const gss_name_t name, + gss_const_OID mech_type, + gss_buffer_t localname); + +/** + * Determine whether a mechanism name is authorized to act as a username. + * + * @param [in] name Mechanism name + * @param [in] username System username + * + * This is a simple wrapper around gss_authorize_localname(). It only supports + * system usernames as local names, and cannot distinguish between lack of + * authorization and other errors. + * + * @retval 1 @a name is authorized to act as @a username + * @retval 0 @a name is not authorized or an error occurred + */ +int KRB5_CALLCONV +gss_userok(const gss_name_t name, + const char *username); + +/** + * Determine whether a mechanism name is authorized to act as a local name. + * + * @param [out] minor Minor status code + * @param [in] name Mechanism name + * @param [in] user Local name + * + * @a name is a mechanism name, typically the result of a completed + * gss_accept_sec_context(). @a user is an internal name representing a local + * name, such as a name imported by gss_import_name() with an @a + * input_name_type of @c GSS_C_NT_USER_NAME. + * + * @return Return GSS_S_COMPLETE if @a name is authorized to act as @a user, + * GSS_S_UNAUTHORIZED if not, or an appropriate GSS error code if an error + * occurred. + * + * @sa gss_userok + */ +OM_uint32 KRB5_CALLCONV +gss_authorize_localname(OM_uint32 *minor, + const gss_name_t name, + const gss_name_t user); + +OM_uint32 KRB5_CALLCONV +gss_acquire_cred_with_password( + OM_uint32 *, /* minor_status */ + const gss_name_t, /* desired_name */ + const gss_buffer_t, /* password */ + OM_uint32, /* time_req */ + const gss_OID_set, /* desired_mechs */ + gss_cred_usage_t, /* cred_usage */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *); /* time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_add_cred_with_password( + OM_uint32 *, /* minor_status */ + const gss_cred_id_t,/* input_cred_handle */ + const gss_name_t, /* desired_name */ + const gss_OID, /* desired_mech */ + const gss_buffer_t, /* password */ + gss_cred_usage_t, /* cred_usage */ + OM_uint32, /* initiator_time_req */ + OM_uint32, /* acceptor_time_req */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *, /* initiator_time_rec */ + OM_uint32 *); /* acceptor_time_rec */ + +/* + * GGF extensions + */ +typedef struct gss_buffer_set_desc_struct { + size_t count; + gss_buffer_desc *elements; +} gss_buffer_set_desc, *gss_buffer_set_t; + +#define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0) + +OM_uint32 KRB5_CALLCONV gss_create_empty_buffer_set + (OM_uint32 * /*minor_status*/, + gss_buffer_set_t * /*buffer_set*/); + +OM_uint32 KRB5_CALLCONV gss_add_buffer_set_member + (OM_uint32 * /*minor_status*/, + const gss_buffer_t /*member_buffer*/, + gss_buffer_set_t * /*buffer_set*/); + +OM_uint32 KRB5_CALLCONV gss_release_buffer_set + (OM_uint32 * /*minor_status*/, + gss_buffer_set_t * /*buffer_set*/); + +OM_uint32 KRB5_CALLCONV gss_inquire_sec_context_by_oid + (OM_uint32 * /*minor_status*/, + const gss_ctx_id_t /*context_handle*/, + const gss_OID /*desired_object*/, + gss_buffer_set_t * /*data_set*/); + +OM_uint32 KRB5_CALLCONV gss_inquire_cred_by_oid + (OM_uint32 * /*minor_status*/, + const gss_cred_id_t /*cred_handle*/, + const gss_OID /*desired_object*/, + gss_buffer_set_t * /*data_set*/); + +OM_uint32 KRB5_CALLCONV gss_set_sec_context_option + (OM_uint32 * /*minor_status*/, + gss_ctx_id_t * /*cred_handle*/, + const gss_OID /*desired_object*/, + const gss_buffer_t /*value*/); + +/* + * Export import cred extensions from GGF, but using Heimdal's signatures + */ +OM_uint32 KRB5_CALLCONV gss_export_cred + (OM_uint32 * /* minor_status */, + gss_cred_id_t /* cred_handle */, + gss_buffer_t /* token */); + +OM_uint32 KRB5_CALLCONV gss_import_cred + (OM_uint32 * /* minor_status */, + gss_buffer_t /* token */, + gss_cred_id_t * /* cred_handle */); + +/* + * Heimdal extension + */ +OM_uint32 KRB5_CALLCONV gss_set_cred_option + (OM_uint32 * /*minor_status*/, + gss_cred_id_t * /*cred*/, + const gss_OID /*desired_object*/, + const gss_buffer_t /*value*/); + +/* + * Call the given method on the given mechanism + */ +OM_uint32 KRB5_CALLCONV gssspi_mech_invoke + (OM_uint32 * /*minor_status*/, + const gss_OID /*desired_mech*/, + const gss_OID /*desired_object*/, + gss_buffer_t /*value*/); + +/* + * AEAD extensions + */ + +OM_uint32 KRB5_CALLCONV gss_wrap_aead + (OM_uint32 * /*minor_status*/, + gss_ctx_id_t /*context_handle*/, + int /*conf_req_flag*/, + gss_qop_t /*qop_req*/, + gss_buffer_t /*input_assoc_buffer*/, + gss_buffer_t /*input_payload_buffer*/, + int * /*conf_state*/, + gss_buffer_t /*output_message_buffer*/); + +OM_uint32 KRB5_CALLCONV gss_unwrap_aead + (OM_uint32 * /*minor_status*/, + gss_ctx_id_t /*context_handle*/, + gss_buffer_t /*input_message_buffer*/, + gss_buffer_t /*input_assoc_buffer*/, + gss_buffer_t /*output_payload_buffer*/, + int * /*conf_state*/, + gss_qop_t * /*qop_state*/); + +/* + * SSPI extensions + */ +#define GSS_C_DCE_STYLE 0x1000 +#define GSS_C_IDENTIFY_FLAG 0x2000 +#define GSS_C_EXTENDED_ERROR_FLAG 0x4000 + +/* + * Returns a buffer set with the first member containing the + * session key for SSPI compatibility. The optional second + * member contains an OID identifying the session key type. + */ +GSS_DLLIMP extern gss_OID GSS_C_INQ_SSPI_SESSION_KEY; + +/* + * Returns a buffer set with the first member containing the ticket session key + * for ODBC compatibility. The optional second member contains an OID + * identifying the session key type. + */ +GSS_DLLIMP extern gss_OID GSS_C_INQ_ODBC_SESSION_KEY; + +GSS_DLLIMP extern gss_OID GSS_C_INQ_NEGOEX_KEY; +GSS_DLLIMP extern gss_OID GSS_C_INQ_NEGOEX_VERIFY_KEY; + +OM_uint32 KRB5_CALLCONV gss_complete_auth_token + (OM_uint32 *minor_status, + const gss_ctx_id_t context_handle, + gss_buffer_t input_message_buffer); + +typedef struct gss_iov_buffer_desc_struct { + OM_uint32 type; + gss_buffer_desc buffer; +} gss_iov_buffer_desc, *gss_iov_buffer_t; + +#define GSS_C_NO_IOV_BUFFER ((gss_iov_buffer_t)0) + +#define GSS_IOV_BUFFER_TYPE_EMPTY 0 +#define GSS_IOV_BUFFER_TYPE_DATA 1 /* Packet data */ +#define GSS_IOV_BUFFER_TYPE_HEADER 2 /* Mechanism header */ +#define GSS_IOV_BUFFER_TYPE_MECH_PARAMS 3 /* Mechanism specific parameters */ +#define GSS_IOV_BUFFER_TYPE_TRAILER 7 /* Mechanism trailer */ +#define GSS_IOV_BUFFER_TYPE_PADDING 9 /* Padding */ +#define GSS_IOV_BUFFER_TYPE_STREAM 10 /* Complete wrap token */ +#define GSS_IOV_BUFFER_TYPE_SIGN_ONLY 11 /* Sign only packet data */ +#define GSS_IOV_BUFFER_TYPE_MIC_TOKEN 12 /* MIC token destination */ + +#define GSS_IOV_BUFFER_FLAG_MASK 0xFFFF0000 +#define GSS_IOV_BUFFER_FLAG_ALLOCATE 0x00010000 /* indicates GSS should allocate */ +#define GSS_IOV_BUFFER_FLAG_ALLOCATED 0x00020000 /* indicates caller should free */ + +#define GSS_IOV_BUFFER_TYPE(_type) ((_type) & ~(GSS_IOV_BUFFER_FLAG_MASK)) +#define GSS_IOV_BUFFER_FLAGS(_type) ((_type) & GSS_IOV_BUFFER_FLAG_MASK) + +/* + * Sign and optionally encrypt a sequence of buffers. The buffers + * shall be ordered HEADER | DATA | PADDING | TRAILER. Suitable + * space for the header, padding and trailer should be provided + * by calling gss_wrap_iov_length(), or the ALLOCATE flag should + * be set on those buffers. + * + * Encryption is in-place. SIGN_ONLY buffers are untouched. Only + * a single PADDING buffer should be provided. The order of the + * buffers in memory does not matter. Buffers in the IOV should + * be arranged in the order above, and in the case of multiple + * DATA buffers the sender and receiver should agree on the + * order. + * + * With GSS_C_DCE_STYLE it is acceptable to not provide PADDING + * and TRAILER, but the caller must guarantee the plaintext data + * being encrypted is correctly padded, otherwise an error will + * be returned. + * + * While applications that have knowledge of the underlying + * cryptosystem may request a specific configuration of data + * buffers, the only generally supported configurations are: + * + * HEADER | DATA | PADDING | TRAILER + * + * which will emit GSS_Wrap() compatible tokens, and: + * + * HEADER | SIGN_ONLY | DATA | PADDING | TRAILER + * + * for AEAD. + * + * The typical (special cased) usage for DCE is as follows: + * + * SIGN_ONLY_1 | DATA | SIGN_ONLY_2 | HEADER + */ +OM_uint32 KRB5_CALLCONV gss_wrap_iov +( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + int *, /* conf_state */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Verify and optionally decrypt a sequence of buffers. To process + * a GSS-API message without separate buffer, pass STREAM | DATA. + * Upon return DATA will contain the decrypted or integrity + * protected message. Only a single DATA buffer may be provided + * with this usage. DATA by default will point into STREAM, but if + * the ALLOCATE flag is set a copy will be returned. + * + * Otherwise, decryption is in-place. SIGN_ONLY buffers are + * untouched. + */ +OM_uint32 KRB5_CALLCONV gss_unwrap_iov +( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int *, /* conf_state */ + gss_qop_t *, /* qop_state */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Query HEADER, PADDING and TRAILER buffer lengths. DATA buffers + * should be provided so the correct padding length can be determined. + */ +OM_uint32 KRB5_CALLCONV gss_wrap_iov_length +( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + int *, /* conf_state */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Produce a GSSAPI MIC token for a sequence of buffers. All SIGN_ONLY and + * DATA buffers will be signed, in the order they appear. One MIC_TOKEN buffer + * must be included for the result. Suitable space should be provided for the + * MIC_TOKEN buffer by calling gss_get_mic_iov_length, or the ALLOCATE flag + * should be set on that buffer. If the ALLOCATE flag is used, use + * gss_release_iov_buffer to free the allocated buffer within the iov list when + * it is no longer needed. + */ +OM_uint32 KRB5_CALLCONV gss_get_mic_iov +( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_qop_t, /* qop_req */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Query the MIC_TOKEN buffer length within the iov list. + */ +OM_uint32 KRB5_CALLCONV gss_get_mic_iov_length( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_qop_t, /* qop_req */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Verify the MIC_TOKEN buffer within the iov list against the SIGN_ONLY and + * DATA buffers in the order they appear. Return values are the same as for + * gss_verify_mic. + */ +OM_uint32 KRB5_CALLCONV gss_verify_mic_iov +( + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_qop_t *, /* qop_state */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Release buffers that have the ALLOCATED flag set. + */ +OM_uint32 KRB5_CALLCONV gss_release_iov_buffer +( + OM_uint32 *, /* minor_status */ + gss_iov_buffer_desc *, /* iov */ + int); /* iov_count */ + +/* + * Protocol transition + */ +OM_uint32 KRB5_CALLCONV +gss_acquire_cred_impersonate_name( + OM_uint32 *, /* minor_status */ + const gss_cred_id_t, /* impersonator_cred_handle */ + const gss_name_t, /* desired_name */ + OM_uint32, /* time_req */ + const gss_OID_set, /* desired_mechs */ + gss_cred_usage_t, /* cred_usage */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *); /* time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_add_cred_impersonate_name( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* input_cred_handle */ + const gss_cred_id_t, /* impersonator_cred_handle */ + const gss_name_t, /* desired_name */ + const gss_OID, /* desired_mech */ + gss_cred_usage_t, /* cred_usage */ + OM_uint32, /* initiator_time_req */ + OM_uint32, /* acceptor_time_req */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *, /* initiator_time_rec */ + OM_uint32 *); /* acceptor_time_rec */ + +/* + * Naming extensions + */ +GSS_DLLIMP extern gss_buffer_t GSS_C_ATTR_LOCAL_LOGIN_USER; +GSS_DLLIMP extern gss_OID GSS_C_NT_COMPOSITE_EXPORT; + +OM_uint32 KRB5_CALLCONV gss_display_name_ext +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + gss_OID, /* display_as_name_type */ + gss_buffer_t /* display_name */ +); + +OM_uint32 KRB5_CALLCONV gss_inquire_name +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + int *, /* name_is_MN */ + gss_OID *, /* MN_mech */ + gss_buffer_set_t * /* attrs */ +); + +OM_uint32 KRB5_CALLCONV gss_get_name_attribute +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + gss_buffer_t, /* attr */ + int *, /* authenticated */ + int *, /* complete */ + gss_buffer_t, /* value */ + gss_buffer_t, /* display_value */ + int * /* more */ +); + +OM_uint32 KRB5_CALLCONV gss_set_name_attribute +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + int, /* complete */ + gss_buffer_t, /* attr */ + gss_buffer_t /* value */ +); + +OM_uint32 KRB5_CALLCONV gss_delete_name_attribute +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + gss_buffer_t /* attr */ +); + +OM_uint32 KRB5_CALLCONV gss_export_name_composite +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + gss_buffer_t /* exp_composite_name */ +); + +typedef struct gss_any *gss_any_t; + +OM_uint32 KRB5_CALLCONV gss_map_name_to_any +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + int, /* authenticated */ + gss_buffer_t, /* type_id */ + gss_any_t * /* output */ +); + +OM_uint32 KRB5_CALLCONV gss_release_any_name_mapping +( + OM_uint32 *, /* minor_status */ + gss_name_t, /* name */ + gss_buffer_t, /* type_id */ + gss_any_t * /* input */ +); + +/* draft-josefsson-gss-capsulate */ +OM_uint32 KRB5_CALLCONV gss_encapsulate_token +( + gss_const_buffer_t, /* input_token */ + gss_const_OID, /* token_oid */ + gss_buffer_t /* output_token */ +); + +OM_uint32 KRB5_CALLCONV gss_decapsulate_token +( + gss_const_buffer_t, /* input_token */ + gss_const_OID, /* token_oid */ + gss_buffer_t /* output_token */ +); + +int KRB5_CALLCONV gss_oid_equal +( + gss_const_OID, /* first_oid */ + gss_const_OID /* second_oid */ +); + +/* Credential store extensions */ + +struct gss_key_value_element_struct { + const char *key; + const char *value; +}; +typedef struct gss_key_value_element_struct gss_key_value_element_desc; + +struct gss_key_value_set_struct { + OM_uint32 count; + gss_key_value_element_desc *elements; +}; +typedef struct gss_key_value_set_struct gss_key_value_set_desc; +typedef const gss_key_value_set_desc *gss_const_key_value_set_t; + +#define GSS_C_NO_CRED_STORE ((gss_const_key_value_set_t) 0) + +OM_uint32 KRB5_CALLCONV +gss_acquire_cred_from( + OM_uint32 *, /* minor_status */ + gss_name_t, /* desired_name */ + OM_uint32, /* time_req */ + gss_OID_set, /* desired_mechs */ + gss_cred_usage_t, /* cred_usage */ + gss_const_key_value_set_t, /* cred_store */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *); /* time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_add_cred_from( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* input_cred_handle */ + gss_name_t, /* desired_name */ + gss_OID, /* desired_mech */ + gss_cred_usage_t, /* cred_usage */ + OM_uint32, /* initiator_time_req */ + OM_uint32, /* acceptor_time_req */ + gss_const_key_value_set_t, /* cred_store */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *, /* initiator_time_rec */ + OM_uint32 *); /* acceptor_time_rec */ + +OM_uint32 KRB5_CALLCONV +gss_store_cred_into( + OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* input_cred_handle */ + gss_cred_usage_t, /* input_usage */ + gss_OID, /* desired_mech */ + OM_uint32, /* overwrite_cred */ + OM_uint32, /* default_cred */ + gss_const_key_value_set_t, /* cred_store */ + gss_OID_set *, /* elements_stored */ + gss_cred_usage_t *); /* cred_usage_stored */ + +/* + * A mech can make itself negotiable via NegoEx (draft-zhu-negoex) by + * implementing the following three SPIs, and also implementing + * gss_inquire_sec_context_by_oid() and answering the GSS_C_INQ_NEGOEX_KEY and + * GSS_C_INQ_NEGOEX_VERIFY_KEY OIDs. The answer must be in two buffers: the + * first contains the key contents, and the second contains the key enctype as + * a four-byte little-endian integer. + * + * By default, NegoEx mechanisms will not be directly negotiated via SPNEGO. + * If direct SPNEGO negotiation is required for interoperability, implement + * gss_inquire_attrs_for_mech() and assert the GSS_C_MA_NEGOEX_AND_SPNEGO + * attribute (along with any applicable RFC 5587 attributes). + */ + +#define GSS_C_CHANNEL_BOUND_FLAG 2048 /* 0x00000800 */ + +OM_uint32 KRB5_CALLCONV +gssspi_query_meta_data( + OM_uint32 *minor_status, + gss_const_OID mech_oid, + gss_cred_id_t cred_handle, + gss_ctx_id_t *context_handle, + const gss_name_t targ_name, + OM_uint32 req_flags, + gss_buffer_t meta_data); + +OM_uint32 KRB5_CALLCONV +gssspi_exchange_meta_data( + OM_uint32 *minor_status, + gss_const_OID mech_oid, + gss_cred_id_t cred_handle, + gss_ctx_id_t *context_handle, + const gss_name_t targ_name, + OM_uint32 req_flags, + gss_const_buffer_t meta_data); + +OM_uint32 KRB5_CALLCONV +gssspi_query_mechanism_info( + OM_uint32 *minor_status, + gss_const_OID mech_oid, + unsigned char auth_scheme[16]); + +GSS_DLLIMP extern gss_const_OID GSS_C_MA_NEGOEX_AND_SPNEGO; + +#ifdef __cplusplus +} +#endif + +/* + * When used with gss_inquire_sec_context_by_oid(), return a buffer set with + * the first member containing an unsigned 32-bit integer in network byte + * order. This is the Security Strength Factor (SSF) associated with the + * secure channel established by the security context. NOTE: This value is + * made available solely as an indication for use by APIs like Cyrus SASL that + * classify the strength of a secure channel via this number. The strength of + * a channel cannot necessarily be represented by a simple number. + */ +GSS_DLLIMP extern gss_OID GSS_C_SEC_CONTEXT_SASL_SSF; + +#endif /* GSSAPI_EXT_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_generic.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_generic.h new file mode 100644 index 0000000000000000000000000000000000000000..e11f938c672b4a56139db73edfb158a1c482d81d --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_generic.h @@ -0,0 +1,59 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_GENERIC_H_ +#define _GSSAPI_GENERIC_H_ + +/* + * $Id$ + */ + +#include + +#if defined(__cplusplus) && !defined(GSSAPIGENERIC_BEGIN_DECLS) +#define GSSAPIGENERIC_BEGIN_DECLS extern "C" { +#define GSSAPIGENERIC_END_DECLS } +#else +#define GSSAPIGENERIC_BEGIN_DECLS +#define GSSAPIGENERIC_END_DECLS +#endif + +#define GSS_EMPTY_BUFFER(buf) ((buf) == NULL || \ + (buf)->value == NULL || (buf)->length == 0) + +GSSAPIGENERIC_BEGIN_DECLS + +/* Deprecated MIT krb5 oid names provided for compatibility. + * The correct oids (GSS_C_NT_USER_NAME, etc) from rfc 2744 + * are defined in gssapi.h. */ + +GSS_DLLIMP extern gss_OID gss_nt_user_name; +GSS_DLLIMP extern gss_OID gss_nt_machine_uid_name; +GSS_DLLIMP extern gss_OID gss_nt_string_uid_name; +extern gss_OID gss_nt_service_name_v2; +GSS_DLLIMP extern gss_OID gss_nt_service_name; +extern gss_OID gss_nt_exported_name; + +GSSAPIGENERIC_END_DECLS + +#endif /* _GSSAPI_GENERIC_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_krb5.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_krb5.h new file mode 100644 index 0000000000000000000000000000000000000000..8141f41db9159ef9cf3b7204c3001c9697c56220 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/gssapi_krb5.h @@ -0,0 +1,305 @@ +/* -*- mode: c; indent-tabs-mode: nil -*- */ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_KRB5_H_ +#define _GSSAPI_KRB5_H_ + +#include +#include +#include +#include + +/* C++ friendlyness */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Reserved static storage for GSS_oids. See rfc 1964 for more details. */ + +/* 2.1.1. Kerberos Principal Name Form: */ +GSS_DLLIMP extern const gss_OID GSS_KRB5_NT_PRINCIPAL_NAME; +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5_name(1)}. The recommended symbolic name for this type + * is "GSS_KRB5_NT_PRINCIPAL_NAME". */ + +/* 2.1.2. Host-Based Service Name Form */ +#define GSS_KRB5_NT_HOSTBASED_SERVICE_NAME GSS_C_NT_HOSTBASED_SERVICE +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) service_name(4)}. The previously recommended symbolic + * name for this type is "GSS_KRB5_NT_HOSTBASED_SERVICE_NAME". The + * currently preferred symbolic name for this type is + * "GSS_C_NT_HOSTBASED_SERVICE". */ + +/* 2.2.1. User Name Form */ +#define GSS_KRB5_NT_USER_NAME GSS_C_NT_USER_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) user_name(1)}. The recommended symbolic name for this + * type is "GSS_KRB5_NT_USER_NAME". */ + +/* 2.2.2. Machine UID Form */ +#define GSS_KRB5_NT_MACHINE_UID_NAME GSS_C_NT_MACHINE_UID_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) machine_uid_name(2)}. The recommended symbolic name for + * this type is "GSS_KRB5_NT_MACHINE_UID_NAME". */ + +/* 2.2.3. String UID Form */ +#define GSS_KRB5_NT_STRING_UID_NAME GSS_C_NT_STRING_UID_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) string_uid_name(3)}. The recommended symbolic name for + * this type is "GSS_KRB5_NT_STRING_UID_NAME". */ + +/* Kerberos Enterprise Name Form (see RFC 6806 section 5): */ +GSS_DLLIMP extern const gss_OID GSS_KRB5_NT_ENTERPRISE_NAME; +/* {iso(1) member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5-enterprise-name(6)}. */ + +/* Kerberos X.509 DER-encoded certificate */ +GSS_DLLIMP extern const gss_OID GSS_KRB5_NT_X509_CERT; +/* {iso(1) member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5-x509-cert(7)}. */ + +GSS_DLLIMP extern const gss_OID gss_mech_krb5; +GSS_DLLIMP extern const gss_OID gss_mech_krb5_old; +GSS_DLLIMP extern const gss_OID gss_mech_krb5_wrong; +GSS_DLLIMP extern const gss_OID gss_mech_iakerb; +GSS_DLLIMP extern const gss_OID_set gss_mech_set_krb5; +GSS_DLLIMP extern const gss_OID_set gss_mech_set_krb5_old; +GSS_DLLIMP extern const gss_OID_set gss_mech_set_krb5_both; + +GSS_DLLIMP extern const gss_OID gss_nt_krb5_name; +GSS_DLLIMP extern const gss_OID gss_nt_krb5_principal; + +GSS_DLLIMP extern const gss_OID_desc krb5_gss_oid_array[]; + +/* + * This OID can be used with gss_set_cred_option() to suppress the + * confidentiality and integrity flags from being asserted in initial context + * tokens. + * + * iso(1) member-body(2) Sweden(752) Stockholm University(43) Heimdal GSS-API + * Extensions(13) no_ci_flags(29) + */ +GSS_DLLIMP extern const gss_OID GSS_KRB5_CRED_NO_CI_FLAGS_X; + +/* + * This OID can be used with gss_inquire_cred_by_oid(0 to retrieve the + * impersonator name (if any). + * + * iso(1) member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5-gssapi-ext(5) get-cred-impersonator(14) + */ +GSS_DLLIMP extern const gss_OID GSS_KRB5_GET_CRED_IMPERSONATOR; + +#define gss_krb5_nt_general_name gss_nt_krb5_name +#define gss_krb5_nt_principal gss_nt_krb5_principal +#define gss_krb5_nt_service_name gss_nt_service_name +#define gss_krb5_nt_user_name gss_nt_user_name +#define gss_krb5_nt_machine_uid_name gss_nt_machine_uid_name +#define gss_krb5_nt_string_uid_name gss_nt_string_uid_name + +typedef struct gss_krb5_lucid_key { + OM_uint32 type; /* key encryption type */ + OM_uint32 length; /* length of key data */ + void * data; /* actual key data */ +} gss_krb5_lucid_key_t; + +typedef struct gss_krb5_rfc1964_keydata { + OM_uint32 sign_alg; /* signing algorithm */ + OM_uint32 seal_alg; /* seal/encrypt algorithm */ + gss_krb5_lucid_key_t ctx_key; + /* Context key + (Kerberos session key or subkey) */ +} gss_krb5_rfc1964_keydata_t; + +typedef struct gss_krb5_cfx_keydata { + OM_uint32 have_acceptor_subkey; + /* 1 if there is an acceptor_subkey + present, 0 otherwise */ + gss_krb5_lucid_key_t ctx_key; + /* Context key + (Kerberos session key or subkey) */ + gss_krb5_lucid_key_t acceptor_subkey; + /* acceptor-asserted subkey or + 0's if no acceptor subkey */ +} gss_krb5_cfx_keydata_t; + +typedef struct gss_krb5_lucid_context_v1 { + OM_uint32 version; /* Structure version number (1) + MUST be at beginning of struct! */ + OM_uint32 initiate; /* Are we the initiator? */ + OM_uint32 endtime; /* expiration time of context */ + uint64_t send_seq; /* sender sequence number */ + uint64_t recv_seq; /* receive sequence number */ + OM_uint32 protocol; /* 0: rfc1964, + 1: draft-ietf-krb-wg-gssapi-cfx-07 */ + /* + * if (protocol == 0) rfc1964_kd should be used + * and cfx_kd contents are invalid and should be zero + * if (protocol == 1) cfx_kd should be used + * and rfc1964_kd contents are invalid and should be zero + */ + gss_krb5_rfc1964_keydata_t rfc1964_kd; + gss_krb5_cfx_keydata_t cfx_kd; +} gss_krb5_lucid_context_v1_t; + +/* + * Mask for determining the version of a lucid context structure. Callers + * should not require this. + */ +typedef struct gss_krb5_lucid_context_version { + OM_uint32 version; /* Structure version number */ +} gss_krb5_lucid_context_version_t; + + + + +/* Alias for Heimdal compat. */ +#define gsskrb5_register_acceptor_identity krb5_gss_register_acceptor_identity + +OM_uint32 KRB5_CALLCONV krb5_gss_register_acceptor_identity(const char *); + +OM_uint32 KRB5_CALLCONV gss_krb5_get_tkt_flags( + OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + krb5_flags *ticket_flags); + +/* + * Copy krb5 creds from cred_handle into out_ccache, which must already be + * initialized. Use gss_store_cred_into() (new in krb5 1.11) instead, if + * possible. + */ +OM_uint32 KRB5_CALLCONV gss_krb5_copy_ccache( + OM_uint32 *minor_status, + gss_cred_id_t cred_handle, + krb5_ccache out_ccache); + +OM_uint32 KRB5_CALLCONV gss_krb5_ccache_name( + OM_uint32 *minor_status, const char *name, + const char **out_name); + +/* + * gss_krb5_set_allowable_enctypes + * + * This function may be called by a context initiator after calling + * gss_acquire_cred(), but before calling gss_init_sec_context(), + * to restrict the set of enctypes which will be negotiated during + * context establishment to those in the provided array. + * + * 'cred' must be a valid credential handle obtained via + * gss_acquire_cred(). It may not be GSS_C_NO_CREDENTIAL. + * gss_acquire_cred() may have been called to get a handle to + * the default credential. + * + * The purpose of this function is to limit the keys that may + * be exported via gss_krb5_export_lucid_sec_context(); thus it + * should limit the enctypes of all keys that will be needed + * after the security context has been established. + * (i.e. context establishment may use a session key with a + * stronger enctype than in the provided array, however a + * subkey must be established within the enctype limits + * established by this function.) + * + */ +OM_uint32 KRB5_CALLCONV +gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status, + gss_cred_id_t cred, + OM_uint32 num_ktypes, + krb5_enctype *ktypes); + +/* + * Returns a non-opaque (lucid) version of the internal context + * information. + * + * Note that context_handle must not be used again by the caller + * after this call. The GSS implementation is free to release any + * resources associated with the original context. It is up to the + * GSS implementation whether it returns pointers to existing data, + * or copies of the data. The caller should treat the returned + * lucid context as read-only. + * + * The caller must call gss_krb5_free_lucid_context() to free + * the context and allocated resources when it is finished with it. + * + * 'version' is an integer indicating the requested version of the lucid + * context. If the implementation does not understand the requested version, + * it will return an error. + * + * For example: + * void *return_ctx; + * gss_krb5_lucid_context_v1_t *ctx; + * OM_uint32 min_stat, maj_stat; + * OM_uint32 vers; + * gss_ctx_id_t *ctx_handle; + * + * maj_stat = gss_krb5_export_lucid_sec_context(&min_stat, + * ctx_handle, 1, &return_ctx); + * // Verify success + * ctx = (gss_krb5_lucid_context_v1_t *) return_ctx; + */ + +OM_uint32 KRB5_CALLCONV +gss_krb5_export_lucid_sec_context(OM_uint32 *minor_status, + gss_ctx_id_t *context_handle, + OM_uint32 version, + void **kctx); + +/* + * Frees the allocated storage associated with an + * exported struct gss_krb5_lucid_context. + */ +OM_uint32 KRB5_CALLCONV +gss_krb5_free_lucid_sec_context(OM_uint32 *minor_status, + void *kctx); + + +OM_uint32 KRB5_CALLCONV +gsskrb5_extract_authz_data_from_sec_context(OM_uint32 *minor_status, + const gss_ctx_id_t context_handle, + int ad_type, + gss_buffer_t ad_data); + +OM_uint32 KRB5_CALLCONV +gss_krb5_set_cred_rcache(OM_uint32 *minor_status, + gss_cred_id_t cred, + krb5_rcache rcache); + +OM_uint32 KRB5_CALLCONV +gsskrb5_extract_authtime_from_sec_context(OM_uint32 *, gss_ctx_id_t, krb5_timestamp *); + +OM_uint32 KRB5_CALLCONV +gss_krb5_import_cred(OM_uint32 *minor_status, + krb5_ccache id, + krb5_principal keytab_principal, + krb5_keytab keytab, + gss_cred_id_t *cred); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GSSAPI_KRB5_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/mechglue.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/mechglue.h new file mode 100644 index 0000000000000000000000000000000000000000..85983694a258a5a8050d7dcec86c81cd3574c0d2 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssapi/mechglue.h @@ -0,0 +1,42 @@ +/* #ident "@(#)mechglue.h 1.13 95/08/07 SMI" */ + +/* + * Copyright 1996 by Sun Microsystems, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Sun Microsystems not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Sun Microsystems makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This header contains the mechglue definitions. + */ + +#ifndef _GSS_MECHGLUE_H +#define _GSS_MECHGLUE_H + +#include + +/********************************************************/ +/* GSSAPI Extension functions -- these functions aren't */ +/* in the GSSAPI, but they are provided in this library */ + +#include + +void KRB5_CALLCONV gss_initialize(void); + +#endif /* _GSS_MECHGLUE_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth.h new file mode 100644 index 0000000000000000000000000000000000000000..0bfa3ec887a6dbb96a4108734ae5be70b1ae89ee --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth.h @@ -0,0 +1,205 @@ +/* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * auth.h, Authentication interface. + * + * The data structures are completely opaque to the client. The client + * is required to pass a AUTH * to routines that create rpc + * "sessions". + */ +#ifndef GSSRPC_AUTH_H +#define GSSRPC_AUTH_H + +#include + +GSSRPC__BEGIN_DECLS + +#define MAX_AUTH_BYTES 400 +#define MAXNETNAMELEN 255 /* maximum length of network user's name */ + +/* + * Status returned from authentication check + */ +enum auth_stat { + AUTH_OK=0, + /* + * failed at remote end + */ + AUTH_BADCRED=1, /* bogus credentials (seal broken) */ + AUTH_REJECTEDCRED=2, /* client should begin new session */ + AUTH_BADVERF=3, /* bogus verifier (seal broken) */ + AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ + AUTH_TOOWEAK=5, /* rejected due to security reasons */ + /* + * failed locally + */ + AUTH_INVALIDRESP=6, /* bogus response verifier */ + AUTH_FAILED=7, /* some unknown reason */ + /* + * RPCSEC_GSS errors + */ + RPCSEC_GSS_CREDPROBLEM = 13, + RPCSEC_GSS_CTXPROBLEM = 14 +}; + +union des_block { + char c[8]; +}; +typedef union des_block des_block; +extern bool_t xdr_des_block(XDR *, des_block *); + +/* + * Authentication info. Opaque to client. + */ +struct opaque_auth { + enum_t oa_flavor; /* flavor of auth */ + caddr_t oa_base; /* address of more auth stuff */ + u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ +}; + + +/* + * Auth handle, interface to client side authenticators. + */ +struct rpc_msg; + +typedef struct AUTH { + struct opaque_auth ah_cred; + struct opaque_auth ah_verf; + union des_block ah_key; + struct auth_ops { + void (*ah_nextverf)(struct AUTH *); + /* nextverf & serialize */ + int (*ah_marshal)(struct AUTH *, XDR *); + /* validate varifier */ + int (*ah_validate)(struct AUTH *, + struct opaque_auth *); + /* refresh credentials */ + int (*ah_refresh)(struct AUTH *, struct rpc_msg *); + /* destroy this structure */ + void (*ah_destroy)(struct AUTH *); + /* encode data for wire */ + int (*ah_wrap)(struct AUTH *, XDR *, + xdrproc_t, caddr_t); + /* decode data from wire */ + int (*ah_unwrap)(struct AUTH *, XDR *, + xdrproc_t, caddr_t); + } *ah_ops; + void *ah_private; +} AUTH; + + +/* + * Authentication ops. + * The ops and the auth handle provide the interface to the authenticators. + * + * AUTH *auth; + * XDR *xdrs; + * struct opaque_auth verf; + */ +#define AUTH_NEXTVERF(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) +#define auth_nextverf(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) + +#define AUTH_MARSHALL(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) +#define auth_marshall(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) + +#define AUTH_VALIDATE(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) +#define auth_validate(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) + +#define AUTH_REFRESH(auth, msg) \ + ((*((auth)->ah_ops->ah_refresh))(auth, msg)) +#define auth_refresh(auth, msg) \ + ((*((auth)->ah_ops->ah_refresh))(auth, msg)) + +#define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ + xfunc, xwhere)) +#define auth_wrap(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ + xfunc, xwhere)) +#define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ + xfunc, xwhere)) +#define auth_unwrap(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ + xfunc, xwhere)) + +#define AUTH_DESTROY(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) +#define auth_destroy(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) + + +#ifdef GSSRPC__IMPL +/* RENAMED: should be _null_auth if we can use reserved namespace. */ +extern struct opaque_auth gssrpc__null_auth; +#endif + +/* + * These are the various implementations of client side authenticators. + */ + +/* + * Unix style authentication + * AUTH *authunix_create(machname, uid, gid, len, aup_gids) + * char *machname; + * int uid; + * int gid; + * int len; + * int *aup_gids; + */ +extern AUTH *authunix_create(char *machname, int uid, int gid, int len, + int *aup_gids); +extern AUTH *authunix_create_default(void); /* takes no parameters */ +extern AUTH *authnone_create(void); /* takes no parameters */ +extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); + +#define AUTH_NONE 0 /* no authentication */ +#define AUTH_NULL 0 /* backward compatibility */ +#define AUTH_UNIX 1 /* unix style (uid, gids) */ +#define AUTH_SHORT 2 /* short hand unix style */ +#define AUTH_DES 3 /* des style (encrypted timestamps) */ +#define AUTH_GSSAPI 300001 /* GSS-API style */ +#define RPCSEC_GSS 6 /* RPCSEC_GSS */ + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_AUTH_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gss.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gss.h new file mode 100644 index 0000000000000000000000000000000000000000..9fa87742fe80a08965095a6bbb5674df29c0d0fa --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gss.h @@ -0,0 +1,148 @@ +/* include/gssrpc/auth_gss.h */ +/* + Copyright (c) 2000 The Regents of the University of Michigan. + All rights reserved. + + Copyright (c) 2000 Dug Song . + All rights reserved, all wrongs reversed. + + 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. Neither the name of the University 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 ``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 REGENTS 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. + + Id: auth_gss.h,v 1.13 2002/05/08 16:54:33 andros Exp +*/ + +#ifndef GSSRPC_AUTH_GSS_H +#define GSSRPC_AUTH_GSS_H + +#include +#include +#ifdef HAVE_HEIMDAL +#include +#else +#include +#endif + +GSSRPC__BEGIN_DECLS + +/* RPCSEC_GSS control procedures. */ +typedef enum { + RPCSEC_GSS_DATA = 0, + RPCSEC_GSS_INIT = 1, + RPCSEC_GSS_CONTINUE_INIT = 2, + RPCSEC_GSS_DESTROY = 3 +} rpc_gss_proc_t; + +/* RPCSEC_GSS services. */ +typedef enum { + RPCSEC_GSS_SVC_NONE = 1, + RPCSEC_GSS_SVC_INTEGRITY = 2, + RPCSEC_GSS_SVC_PRIVACY = 3 +} rpc_gss_svc_t; + +#define RPCSEC_GSS_VERSION 1 + +/* RPCSEC_GSS security triple. */ +struct rpc_gss_sec { + gss_OID mech; /* mechanism */ + gss_qop_t qop; /* quality of protection */ + rpc_gss_svc_t svc; /* service */ + gss_cred_id_t cred; /* cred handle */ + uint32_t req_flags; /* req flags for init_sec_context */ +}; + +/* Private data required for kernel implementation */ +struct authgss_private_data { + gss_ctx_id_t pd_ctx; /* Session context handle */ + gss_buffer_desc pd_ctx_hndl; /* Credentials context handle */ + uint32_t pd_seq_win; /* Sequence window */ +}; + +/* Krb 5 default mechanism +#define KRB5OID "1.2.840.113554.1.2.2" + +gss_OID_desc krb5oid = { + 20, KRB5OID +}; + */ + +/* +struct rpc_gss_sec krb5mech = { + (gss_OID)&krb5oid, + GSS_QOP_DEFAULT, + RPCSEC_GSS_SVC_NONE +}; +*/ + +/* Credentials. */ +struct rpc_gss_cred { + u_int gc_v; /* version */ + rpc_gss_proc_t gc_proc; /* control procedure */ + uint32_t gc_seq; /* sequence number */ + rpc_gss_svc_t gc_svc; /* service */ + gss_buffer_desc gc_ctx; /* context handle */ +}; + +/* Context creation response. */ +struct rpc_gss_init_res { + gss_buffer_desc gr_ctx; /* context handle */ + uint32_t gr_major; /* major status */ + uint32_t gr_minor; /* minor status */ + uint32_t gr_win; /* sequence window */ + gss_buffer_desc gr_token; /* token */ +}; + +/* Maximum sequence number value. */ +#define MAXSEQ 0x80000000 + +/* Prototypes. */ +bool_t xdr_rpc_gss_buf (XDR *xdrs, gss_buffer_t, u_int maxsize); +bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p); +bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p); +bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p); +bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func, + caddr_t xdr_ptr, gss_ctx_id_t ctx, + gss_qop_t qop, rpc_gss_svc_t svc, + uint32_t seq); +bool_t xdr_rpc_gss_wrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t + xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop, + rpc_gss_svc_t svc, uint32_t seq); +bool_t xdr_rpc_gss_unwrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t + xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop, + rpc_gss_svc_t svc, uint32_t seq); + +AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *); +AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *); +bool_t authgss_service (AUTH *auth, int svc); +bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *); + +#ifdef GSSRPC__IMPL +void log_debug (const char *fmt, ...); +void log_status (char *m, OM_uint32 major, OM_uint32 minor); +void log_hexdump (const u_char *buf, int len, int offset); +#endif + +GSSRPC__END_DECLS +#endif /* !defined(GSSRPC_AUTH_GSS_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gssapi.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gssapi.h new file mode 100644 index 0000000000000000000000000000000000000000..63436a698a0c3797567d65e64ba8c841020f3b65 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_gssapi.h @@ -0,0 +1,160 @@ +/* include/gssrpc/auth_gssapi.h - GSS-API style auth parameters for RPC */ +/* + * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. + */ + +#ifndef GSSRPC_AUTH_GSSAPI_H +#define GSSRPC_AUTH_GSSAPI_H + +GSSRPC__BEGIN_DECLS + +#define AUTH_GSSAPI_EXIT 0 +#define AUTH_GSSAPI_INIT 1 +#define AUTH_GSSAPI_CONTINUE_INIT 2 +#define AUTH_GSSAPI_MSG 3 +#define AUTH_GSSAPI_DESTROY 4 + +/* + * Yuck. Some sys/types.h files leak symbols + */ +#ifdef major +#undef major +#endif +#ifdef minor +#undef minor +#endif + +typedef struct _auth_gssapi_name { + char *name; + gss_OID type; +} auth_gssapi_name; + +typedef struct _auth_gssapi_creds { + uint32_t version; + bool_t auth_msg; + gss_buffer_desc client_handle; +} auth_gssapi_creds; + +typedef struct _auth_gssapi_init_arg { + uint32_t version; + gss_buffer_desc token; +} auth_gssapi_init_arg; + +typedef struct _auth_gssapi_init_res { + uint32_t version; + gss_buffer_desc client_handle; + OM_uint32 gss_major, gss_minor; + gss_buffer_desc token; + gss_buffer_desc signed_isn; +} auth_gssapi_init_res; + +typedef void (*auth_gssapi_log_badauth_func) + (OM_uint32 major, + OM_uint32 minor, + struct sockaddr_in *raddr, + caddr_t data); + +/* auth_gssapi_log_badauth_func is IPv4-specific; this version gives the + * transport handle so the fd can be used to get the address. */ +typedef void (*auth_gssapi_log_badauth2_func) + (OM_uint32 major, + OM_uint32 minor, + SVCXPRT *xprt, + caddr_t data); + +typedef void (*auth_gssapi_log_badverf_func) + (gss_name_t client, + gss_name_t server, + struct svc_req *rqst, + struct rpc_msg *msg, + caddr_t data); + +typedef void (*auth_gssapi_log_miscerr_func) + (struct svc_req *rqst, + struct rpc_msg *msg, + char *error, + caddr_t data); + +bool_t xdr_gss_buf(XDR *, gss_buffer_t); +bool_t xdr_authgssapi_creds(XDR *, auth_gssapi_creds *); +bool_t xdr_authgssapi_init_arg(XDR *, auth_gssapi_init_arg *); +bool_t xdr_authgssapi_init_res(XDR *, auth_gssapi_init_res *); + +bool_t auth_gssapi_wrap_data +(OM_uint32 *major, OM_uint32 *minor, + gss_ctx_id_t context, uint32_t seq_num, + XDR *out_xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr); +bool_t auth_gssapi_unwrap_data +(OM_uint32 *major, OM_uint32 *minor, + gss_ctx_id_t context, uint32_t seq_num, + XDR *in_xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr); + +AUTH *auth_gssapi_create +(CLIENT *clnt, + OM_uint32 *major_status, + OM_uint32 *minor_status, + gss_cred_id_t claimant_cred_handle, + gss_name_t target_name, + gss_OID mech_type, + OM_uint32 req_flags, + OM_uint32 time_req, + gss_OID *actual_mech_type, + OM_uint32 *ret_flags, + OM_uint32 *time_rec); + +AUTH *auth_gssapi_create_default +(CLIENT *clnt, char *service_name); + +void auth_gssapi_display_status +(char *msg, OM_uint32 major, + OM_uint32 minor); + +bool_t auth_gssapi_seal_seq +(gss_ctx_id_t context, uint32_t seq_num, gss_buffer_t out_buf); + +bool_t auth_gssapi_unseal_seq +(gss_ctx_id_t context, gss_buffer_t in_buf, uint32_t *seq_num); + +bool_t svcauth_gssapi_set_names +(auth_gssapi_name *names, int num); +void svcauth_gssapi_unset_names +(void); + +void svcauth_gssapi_set_log_badauth_func +(auth_gssapi_log_badauth_func func, + caddr_t data); +void svcauth_gssapi_set_log_badauth2_func +(auth_gssapi_log_badauth2_func func, + caddr_t data); +void svcauth_gssapi_set_log_badverf_func +(auth_gssapi_log_badverf_func func, + caddr_t data); +void svcauth_gssapi_set_log_miscerr_func +(auth_gssapi_log_miscerr_func func, + caddr_t data); + +void svcauth_gss_set_log_badauth_func(auth_gssapi_log_badauth_func, + caddr_t); +void svcauth_gss_set_log_badauth2_func(auth_gssapi_log_badauth2_func, + caddr_t); +void svcauth_gss_set_log_badverf_func(auth_gssapi_log_badverf_func, + caddr_t); +void svcauth_gss_set_log_miscerr_func(auth_gssapi_log_miscerr_func, + caddr_t data); + +#define GSS_COPY_BUFFER(dest, src) { \ + (dest).length = (src).length; \ + (dest).value = (src).value; } + +#define GSS_DUP_BUFFER(dest, src) { \ + (dest).length = (src).length; \ + (dest).value = (void *) malloc((dest).length); \ + memcpy((dest).value, (src).value, (dest).length); } + +#define GSS_BUFFERS_EQUAL(b1, b2) (((b1).length == (b2).length) && \ + !memcmp((b1).value,(b2).value,(b1.length))) + + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_AUTH_GSSAPI_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_unix.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_unix.h new file mode 100644 index 0000000000000000000000000000000000000000..6dda1af5cc4ccf783825b1651c4771f0d0ead725 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/auth_unix.h @@ -0,0 +1,82 @@ +/* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ +/* @(#)auth_unix.h 1.5 86/07/16 SMI */ + +/* + * auth_unix.h, Protocol for UNIX style authentication parameters for RPC + */ + +#ifndef GSSRPC_AUTH_UNIX_H +#define GSSRPC_AUTH_UNIX_H + +GSSRPC__BEGIN_DECLS +/* + * The system is very weak. The client uses no encryption for it + * credentials and only sends null verifiers. The server sends backs + * null verifiers or optionally a verifier that suggests a new short hand + * for the credentials. + */ + +/* The machine name is part of a credential; it may not exceed 255 bytes */ +#define MAX_MACHINE_NAME 255 + +/* gids compose part of a credential; there may not be more than 16 of them */ +#define NGRPS 16 + +/* + * Unix style credentials. + */ +struct authunix_parms { + uint32_t aup_time; + char *aup_machname; + int aup_uid; + int aup_gid; + u_int aup_len; + int *aup_gids; +}; + +extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *); + +/* + * If a response verifier has flavor AUTH_SHORT, + * then the body of the response verifier encapsulates the following structure; + * again it is serialized in the obvious fashion. + */ +struct short_hand_verf { + struct opaque_auth new_cred; +}; + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_AUTH_UNIX_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/clnt.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/clnt.h new file mode 100644 index 0000000000000000000000000000000000000000..e5af80d43840c6fcd5da517b63caf5c9463051dd --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/clnt.h @@ -0,0 +1,346 @@ +/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * clnt.h - Client side remote procedure call interface. + */ + +#ifndef GSSRPC_CLNT_H +#define GSSRPC_CLNT_H + +GSSRPC__BEGIN_DECLS +/* + * Rpc calls return an enum clnt_stat. This should be looked at more, + * since each implementation is required to live with this (implementation + * independent) list of errors. + */ +enum clnt_stat { + RPC_SUCCESS=0, /* call succeeded */ + /* + * local errors + */ + RPC_CANTENCODEARGS=1, /* can't encode arguments */ + RPC_CANTDECODERES=2, /* can't decode results */ + RPC_CANTSEND=3, /* failure in sending call */ + RPC_CANTRECV=4, /* failure in receiving result */ + RPC_TIMEDOUT=5, /* call timed out */ + /* + * remote errors + */ + RPC_VERSMISMATCH=6, /* rpc versions not compatible */ + RPC_AUTHERROR=7, /* authentication error */ + RPC_PROGUNAVAIL=8, /* program not available */ + RPC_PROGVERSMISMATCH=9, /* program version mismatched */ + RPC_PROCUNAVAIL=10, /* procedure unavailable */ + RPC_CANTDECODEARGS=11, /* decode arguments error */ + RPC_SYSTEMERROR=12, /* generic "other problem" */ + + /* + * callrpc & clnt_create errors + */ + RPC_UNKNOWNHOST=13, /* unknown host name */ + RPC_UNKNOWNPROTO=17, /* unknown protocol */ + + /* + * _ create errors + */ + RPC_PMAPFAILURE=14, /* the pmapper failed in its call */ + RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ + /* + * unspecified error + */ + RPC_FAILED=16 +}; + + +/* + * Error info. + */ +struct rpc_err { + enum clnt_stat re_status; + union { + int RE_errno; /* realated system error */ + enum auth_stat RE_why; /* why the auth error occurred */ + struct { + rpcvers_t low; /* lowest version supported */ + rpcvers_t high; /* highest version supported */ + } RE_vers; + struct { /* maybe meaningful if RPC_FAILED */ + int32_t s1; + int32_t s2; + } RE_lb; /* life boot & debugging only */ + } ru; +#define re_errno ru.RE_errno +#define re_why ru.RE_why +#define re_vers ru.RE_vers +#define re_lb ru.RE_lb +}; + + +/* + * Client rpc handle. + * Created by individual implementations, see e.g. rpc_udp.c. + * Client is responsible for initializing auth, see e.g. auth_none.c. + */ +typedef struct CLIENT { + AUTH *cl_auth; /* authenticator */ + struct clnt_ops { + /* call remote procedure */ + enum clnt_stat (*cl_call)(struct CLIENT *, + rpcproc_t, xdrproc_t, void *, + xdrproc_t, void *, + struct timeval); + /* abort a call */ + void (*cl_abort)(struct CLIENT *); + /* get specific error code */ + void (*cl_geterr)(struct CLIENT *, + struct rpc_err *); + /* frees results */ + bool_t (*cl_freeres)(struct CLIENT *, + xdrproc_t, void *); + /* destroy this structure */ + void (*cl_destroy)(struct CLIENT *); + /* the ioctl() of rpc */ + /* XXX CITI makes 2nd arg take u_int */ + bool_t (*cl_control)(struct CLIENT *, int, + void *); + } *cl_ops; + void *cl_private; /* private stuff */ +} CLIENT; + + +/* + * client side rpc interface ops + * + * Parameter types are: + * + */ + +/* + * enum clnt_stat + * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) + * CLIENT *rh; + * rpcproc_t proc; + * xdrproc_t xargs; + * caddr_t argsp; + * xdrproc_t xres; + * caddr_t resp; + * struct timeval timeout; + */ +#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) +#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) + +/* + * void + * CLNT_ABORT(rh); + * CLIENT *rh; + */ +#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) +#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) + +/* + * struct rpc_err + * CLNT_GETERR(rh); + * CLIENT *rh; + */ +#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) +#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) + + +/* + * bool_t + * CLNT_FREERES(rh, xres, resp); + * CLIENT *rh; + * xdrproc_t xres; + * caddr_t resp; + */ +#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) +#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) + +/* + * bool_t + * CLNT_CONTROL(cl, request, info) + * CLIENT *cl; + * u_int request; + * char *info; + */ +#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) +#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) + +/* + * control operations that apply to both udp and tcp transports + */ +#define CLSET_TIMEOUT 1 /* set timeout (timeval) */ +#define CLGET_TIMEOUT 2 /* get timeout (timeval) */ +#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ +/* + * udp only control operations + */ +#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ +#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ +/* + * new control operations + */ +#define CLGET_LOCAL_ADDR 6 /* get local address (sockaddr, getsockname)*/ + +/* + * void + * CLNT_DESTROY(rh); + * CLIENT *rh; + */ +#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) +#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) + + +/* + * RPCTEST is a test program which is accessible on every rpc + * transport/port. It is used for testing, performance evaluation, + * and network administration. + */ + +#define RPCTEST_PROGRAM ((rpcprog_t)1) +#define RPCTEST_VERSION ((rpcvers_t)1) +#define RPCTEST_NULL_PROC ((rpcproc_t)2) +#define RPCTEST_NULL_BATCH_PROC ((rpcproc_t)3) + +/* + * By convention, procedure 0 takes null arguments and returns them + */ + +#define NULLPROC ((rpcproc_t)0) + +/* + * Below are the client handle creation routines for the various + * implementations of client side rpc. They can return NULL if a + * creation failure occurs. + */ + +/* + * Memory based rpc (for speed check and testing) + * CLIENT * + * clntraw_create(prog, vers) + * rpcprog_t prog; + * rpcvers_t vers; + */ +extern CLIENT *clntraw_create(rpcprog_t, rpcvers_t); + +/* + * Generic client creation routine. Supported protocols are "udp" and "tcp" + */ +extern CLIENT *clnt_create(char *, rpcprog_t, rpcvers_t, char *); + + +/* + * TCP based rpc + * CLIENT * + * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) + * struct sockaddr_in *raddr; + * rpcprog_t prog; + * rpcvers_t version; + * int *sockp; + * u_int sendsz; + * u_int recvsz; + */ +extern CLIENT *clnttcp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t, + int *, u_int, u_int); + +/* + * UDP based rpc. + * CLIENT * + * clntudp_create(raddr, program, version, wait, sockp) + * struct sockaddr_in *raddr; + * rpcprog_t program; + * rpcvers_t version; + * struct timeval wait; + * int *sockp; + * + * Same as above, but you specify max packet sizes. + * CLIENT * + * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) + * struct sockaddr_in *raddr; + * rpcprog_t program; + * rpcvers_t version; + * struct timeval wait; + * int *sockp; + * u_int sendsz; + * u_int recvsz; + */ +extern CLIENT *clntudp_create(struct sockaddr_in *, rpcprog_t, + rpcvers_t, struct timeval, int *); +extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, rpcprog_t, + rpcvers_t, struct timeval, int *, + u_int, u_int); + +/* + * Print why creation failed + */ +void clnt_pcreateerror(char *); /* stderr */ +char *clnt_spcreateerror(char *); /* string */ + +/* + * Like clnt_perror(), but is more verbose in its output + */ +void clnt_perrno(enum clnt_stat); /* stderr */ + +/* + * Print an English error message, given the client error code + */ +void clnt_perror(CLIENT *, char *); /* stderr */ +char *clnt_sperror(CLIENT *, char *); /* string */ + +/* + * If a creation fails, the following allows the user to figure out why. + */ +struct rpc_createerr { + enum clnt_stat cf_stat; + struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ +}; + +extern struct rpc_createerr rpc_createerr; + + + +/* + * Copy error message to buffer. + */ +char *clnt_sperrno(enum clnt_stat num); /* string */ + +#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ +#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_CLNT_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/netdb.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/netdb.h new file mode 100644 index 0000000000000000000000000000000000000000..2f62edfec9a3ee1c167441415be79fdba4fe4313 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/netdb.h @@ -0,0 +1,60 @@ +/* include/gssrpc/netdb.h */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ +/* @(#)rpc.h 1.8 87/07/24 SMI */ + +#ifndef RPC_NETDB_H +#define RPC_NETDB_H + +#include +/* since the gssrpc library requires that any application using it be +built with these header files, I am making the decision that any app +which uses the rpcent routines must use this header file, or something +compatible (which most are) --marc */ + +/* Really belongs in */ +#ifdef STRUCT_RPCENT_IN_RPC_NETDB_H +struct rpcent { + char *r_name; /* name of server for this rpc program */ + char **r_aliases; /* alias list */ + int r_number; /* rpc program number */ +}; +#endif /*STRUCT_RPCENT_IN_RPC_NETDB_H*/ + +struct rpcent *getrpcbyname(const char *name); +struct rpcent *getrpcbynumber(int number); +struct rpcent *getrpcent(void); + +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_clnt.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_clnt.h new file mode 100644 index 0000000000000000000000000000000000000000..993bce27cd9424a586605b583122e41cb6aa46cf --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_clnt.h @@ -0,0 +1,83 @@ +/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * pmap_clnt.h + * Supplies C routines to get to portmap services. + */ + +#ifndef GSSRPC_PMAP_CLNT_H +#define GSSRPC_PMAP_CLNT_H + +/* + * Usage: + * success = pmap_set(program, version, protocol, port); + * success = pmap_unset(program, version); + * port = pmap_getport(address, program, version, protocol); + * head = pmap_getmaps(address); + * clnt_stat = pmap_rmtcall(address, program, version, procedure, + * xdrargs, argsp, xdrres, resp, tout, port_ptr) + * (works for udp only.) + * clnt_stat = clnt_broadcast(program, version, procedure, + * xdrargs, argsp, xdrres, resp, eachresult) + * (like pmap_rmtcall, except the call is broadcasted to all + * locally connected nets. For each valid response received, + * the procedure eachresult is called. Its form is: + * done = eachresult(resp, raddr) + * bool_t done; + * caddr_t resp; + * struct sockaddr_in raddr; + * where resp points to the results of the call and raddr is the + * address if the responder to the broadcast. + */ + +GSSRPC__BEGIN_DECLS +extern bool_t pmap_set(rpcprog_t, rpcvers_t, rpcprot_t, u_int); +extern bool_t pmap_unset(rpcprog_t, rpcvers_t); +extern struct pmaplist *pmap_getmaps(struct sockaddr_in *); +enum clnt_stat pmap_rmtcall(struct sockaddr_in *, rpcprog_t, + rpcvers_t, rpcproc_t, xdrproc_t, + caddr_t, xdrproc_t, caddr_t, + struct timeval, rpcport_t *); + +typedef bool_t (*resultproc_t)(caddr_t, struct sockaddr_in *); + +enum clnt_stat clnt_broadcast(rpcprog_t, rpcvers_t, rpcproc_t, + xdrproc_t, caddr_t, xdrproc_t, + caddr_t, resultproc_t); +extern u_short pmap_getport(struct sockaddr_in *, + rpcprog_t, + rpcvers_t, rpcprot_t); +GSSRPC__END_DECLS +#endif /* !defined(GSSRPC_PMAP_CLNT_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_prot.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_prot.h new file mode 100644 index 0000000000000000000000000000000000000000..0e35d6b9fbd77b9e3cc9e0e71ef7fe5263990f7a --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_prot.h @@ -0,0 +1,103 @@ +/* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * pmap_prot.h + * Protocol for the local binder service, or pmap. + * + * The following procedures are supported by the protocol: + * + * PMAPPROC_NULL() returns () + * takes nothing, returns nothing + * + * PMAPPROC_SET(struct pmap) returns (bool_t) + * TRUE is success, FALSE is failure. Registers the tuple + * [prog, vers, prot, port]. + * + * PMAPPROC_UNSET(struct pmap) returns (bool_t) + * TRUE is success, FALSE is failure. Un-registers pair + * [prog, vers]. prot and port are ignored. + * + * PMAPPROC_GETPORT(struct pmap) returns (u_short). + * 0 is failure. Otherwise returns the port number where the pair + * [prog, vers] is registered. It may lie! + * + * PMAPPROC_DUMP() RETURNS (struct pmaplist *) + * + * PMAPPROC_CALLIT(rpcprog_t, rpcvers_t, rpcproc_t, string<>) + * RETURNS (port, string<>); + * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); + * Calls the procedure on the local machine. If it is not registered, + * this procedure is quite; ie it does not return error information!!! + * This procedure only is supported on rpc/udp and calls via + * rpc/udp. This routine only passes null authentication parameters. + * This file has no interface to xdr routines for PMAPPROC_CALLIT. + * + * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. + */ + +#ifndef GSSRPC_PMAP_PROT_H +#define GSSRPC_PMAP_PROT_H +GSSRPC__BEGIN_DECLS + +#define PMAPPORT ((u_short)111) +#define PMAPPROG ((rpcprog_t)100000) +#define PMAPVERS ((rpcvers_t)2) +#define PMAPVERS_PROTO ((rpcprot_t)2) +#define PMAPVERS_ORIG ((rpcvers_t)1) +#define PMAPPROC_NULL ((rpcproc_t)0) +#define PMAPPROC_SET ((rpcproc_t)1) +#define PMAPPROC_UNSET ((rpcproc_t)2) +#define PMAPPROC_GETPORT ((rpcproc_t)3) +#define PMAPPROC_DUMP ((rpcproc_t)4) +#define PMAPPROC_CALLIT ((rpcproc_t)5) + +struct pmap { + rpcprog_t pm_prog; + rpcvers_t pm_vers; + rpcprot_t pm_prot; + rpcport_t pm_port; +}; + +extern bool_t xdr_pmap(XDR *, struct pmap *); + +struct pmaplist { + struct pmap pml_map; + struct pmaplist *pml_next; +}; + +extern bool_t xdr_pmaplist(XDR *, struct pmaplist **); + +GSSRPC__END_DECLS +#endif /* !defined(GSSRPC_PMAP_PROT_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_rmt.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_rmt.h new file mode 100644 index 0000000000000000000000000000000000000000..e978a8ee8c5b8073bacccb14096dd5483a33455a --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/pmap_rmt.h @@ -0,0 +1,65 @@ +/* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * Structures and XDR routines for parameters to and replies from + * the portmapper remote-call-service. + */ + +#ifndef GSSRPC_PMAP_RMT_H +#define GSSRPC_PMAP_RMT_H +GSSRPC__BEGIN_DECLS + +struct rmtcallargs { + rpcprog_t prog; + rpcvers_t vers; + rpcproc_t proc; + uint32_t arglen; + caddr_t args_ptr; + xdrproc_t xdr_args; +}; + +bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *); + +struct rmtcallres { + rpcport_t *port_ptr; + uint32_t resultslen; + caddr_t results_ptr; + xdrproc_t xdr_results; +}; + +bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); + +GSSRPC__END_DECLS +#endif /* !defined(GSSRPC_PMAP_RMT_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rename.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rename.h new file mode 100644 index 0000000000000000000000000000000000000000..d67502fe59efdcf77f5da5ffb62f9144ae7aaf00 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rename.h @@ -0,0 +1,280 @@ +/* include/gssrpc/rename.h */ +/* + * Copyright (C) 2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* + * + * Namespace mangling for various purposes. + * + * Symbols in the object code need to be renamed to not conflict with + * an OS-provided RPC implementation. Without renaming, the conflicts + * can cause problems with things like RPC-enabled NSS + * implementations. + * + * Symbols in headers should not conflict with implementation-reserved + * namespace (prefixes "_[A-Z_]" for any purpose; prefix "_" + * for file scope identifiers and tag names), or unnecessarily impinge + * on user namespace. + * + * The renaming of the header directory is done to avoid problems when + * the OS header files include and might get ours instead. + * OS vendors should replace all the inclusions with + * inclusions, as appropriate. Additionally, vendors + * should probably put some symbols into the implementation namespace. + * + * For example, inclusion protection should change from "GSSRPC_*_H" + * to "_RPC_*_H", struct tags should get "__" prefixes, etc. + * + * This implementation reserves the object code prefix "gssrpc_". + * External names in the RPC API not beginning with "_" get renamed + * with the prefix "gssrpc_" via #define, e.g., "foo" -> "gssrpc_foo". + * External names in the RPC API beginning with "_" get textually + * rewritten. + */ + +#ifndef GSSRPC_RENAME_H +#define GSSRPC_RENAME_H + +/* auth.h */ + +#define xdr_des_block gssrpc_xdr_des_block + +#define authunix_create gssrpc_authunix_create +#define authunix_create_default gssrpc_authunix_create_default +#define authnone_create gssrpc_authnone_create +#define xdr_opaque_auth gssrpc_xdr_opaque_auth + +/* auth_gss.c */ + +#define auth_debug_gss gssrpc_auth_debug_gss +#define misc_debug_gss gssrpc_misc_debug_gss + +/* auth_gss.h */ + +#define xdr_rpc_gss_buf gssrpc_xdr_rpc_gss_buf +#define xdr_rpc_gss_cred gssrpc_xdr_rpc_gss_cred +#define xdr_rpc_gss_init_args gssrpc_xdr_rpc_gss_init_args +#define xdr_rpc_gss_init_res gssrpc_xdr_rpc_gss_init_res +#define xdr_rpc_gss_data gssrpc_xdr_rpc_gss_data +#define xdr_rpc_gss_wrap_data gssrpc_xdr_rpc_gss_wrap_data +#define xdr_rpc_gss_unwrap_data gssrpc_xdr_rpc_gss_unwrap_data + +#define authgss_create gssrpc_authgss_create +#define authgss_create_default gssrpc_authgss_create_default +#define authgss_get_private_data gssrpc_authgss_get_private_data +#define authgss_service gssrpc_authgss_service + +#ifdef GSSRPC__IMPL +#define log_debug gssrpc_log_debug +#define log_status gssrpc_log_status +#define log_hexdump gssrpc_log_hexdump +#endif + +/* auth_gssapi.c */ + +#define auth_debug_gssapi gssrpc_auth_debug_gssapi +#define misc_debug_gssapi gssrpc_misc_debug_gssapi + +/* auth_gssapi.h */ + +#define xdr_gss_buf gssrpc_xdr_gss_buf +#define xdr_authgssapi_creds gssrpc_xdr_authgssapi_creds +#define xdr_authgssapi_init_arg gssrpc_xdr_authgssapi_init_arg +#define xdr_authgssapi_init_res gssrpc_xdr_authgssapi_init_res + +#define auth_gssapi_wrap_data gssrpc_auth_gssapi_wrap_data +#define auth_gssapi_unwrap_data gssrpc_auth_gssapi_unwrap_data +#define auth_gssapi_create gssrpc_auth_gssapi_create +#define auth_gssapi_create_default gssrpc_auth_gssapi_create_default +#define auth_gssapi_display_status gssrpc_auth_gssapi_display_status +#define auth_gssapi_seal_seq gssrpc_auth_gssapi_seal_seq +#define auth_gssapi_unseal_seq gssrpc_auth_gssapi_unseal_seq + +#define svcauth_gssapi_set_names gssrpc_svcauth_gssapi_set_names +#define svcauth_gssapi_unset_names gssrpc_svcauth_gssapi_unset_names +#define svcauth_gssapi_set_log_badauth_func gssrpc_svcauth_gssapi_set_log_badauth_func +#define svcauth_gssapi_set_log_badauth2_func gssrpc_svcauth_gssapi_set_log_badauth2_func +#define svcauth_gssapi_set_log_badverf_func gssrpc_svcauth_gssapi_set_log_badverf_func +#define svcauth_gssapi_set_log_miscerr_func gssrpc_svcauth_gssapi_set_log_miscerr_func + +#define svcauth_gss_set_log_badauth_func gssrpc_svcauth_gss_set_log_badauth_func +#define svcauth_gss_set_log_badauth2_func gssrpc_svcauth_gss_set_log_badauth2_func +#define svcauth_gss_set_log_badverf_func gssrpc_svcauth_gss_set_log_badverf_func +#define svcauth_gss_set_log_miscerr_func gssrpc_svcauth_gss_set_log_miscerr_func + +/* auth_unix.h */ + +#define xdr_authunix_parms gssrpc_xdr_authunix_parms + +/* clnt.h */ + +#define clntraw_create gssrpc_clntraw_create +#define clnt_create gssrpc_clnt_create +#define clnttcp_create gssrpc_clnttcp_create +#define clntudp_create gssrpc_clntudp_create +#define clntudp_bufcreate gssrpc_clntudp_bufcreate +#define clnt_pcreateerror gssrpc_clnt_pcreateerror +#define clnt_spcreateerror gssrpc_clnt_spcreateerror +#define clnt_perrno gssrpc_clnt_perrno +#define clnt_perror gssrpc_clnt_perror +#define clnt_sperror gssrpc_clnt_sperror +/* XXX do we need to rename the struct? */ +#define rpc_createerr gssrpc_rpc_createrr +#define clnt_sperrno gssrpc_clnt_sperrno + +/* pmap_clnt.h */ + +#define pmap_set gssrpc_pmap_set +#define pmap_unset gssrpc_pmap_unset +#define pmap_getmaps gssrpc_pmap_getmaps +#define pmap_rmtcall gssrpc_pmap_rmtcall +#define clnt_broadcast gssrpc_clnt_broadcast +#define pmap_getport gssrpc_pmap_getport + +/* pmap_prot.h */ + +#define xdr_pmap gssrpc_xdr_pmap +#define xdr_pmaplist gssrpc_xdr_pmaplist + +/* pmap_rmt.h */ + +#define xdr_rmtcall_args gssrpc_xdr_rmtcall_args +#define xdr_rmtcallres gssrpc_xdr_rmtcallres + +/* rpc.h */ + +#define get_myaddress gssrpc_get_myaddress +#define bindresvport gssrpc_bindresvport +#define bindresvport_sa gssrpc_bindresvport_sa +#define callrpc gssrpc_callrpc +#define getrpcport gssrpc_getrpcport + +/* rpc_msg.h */ + +#define xdr_callmsg gssrpc_xdr_callmsg +#define xdr_callhdr gssrpc_xdr_callhdr +#define xdr_replymsg gssrpc_xdr_replymsg +#define xdr_accepted_reply gssrpc_xdr_accepted_reply +#define xdr_rejected_reply gssrpc_xdr_rejected_reply + +/* svc.h */ + +#define svc_register gssrpc_svc_register +#define registerrpc gssrpc_registerrpc +#define svc_unregister gssrpc_svc_unregister +#define xprt_register gssrpc_xprt_register +#define xprt_unregister gssrpc_xprt_unregister + +#define svc_sendreply gssrpc_svc_sendreply +#define svcerr_decode gssrpc_svcerr_decode +#define svcerr_weakauth gssrpc_svcerr_weakauth +#define svcerr_noproc gssrpc_svcerr_noproc +#define svcerr_progvers gssrpc_svcerr_progvers +#define svcerr_auth gssrpc_svcerr_auth +#define svcerr_noprog gssrpc_svcerr_noprog +#define svcerr_systemerr gssrpc_svcerr_systemerr + +#define svc_maxfd gssrpc_svc_maxfd +#define svc_fdset gssrpc_svc_fdset +#define svc_fds gssrpc_svc_fds + +#define svc_getreq gssrpc_svc_getreq +#define svc_getreqset gssrpc_svc_getreqset +#define svc_run gssrpc_svc_run + +#define svcraw_create gssrpc_svcraw_create + +#define svcudp_create gssrpc_svcudp_create +#define svcudp_bufcreate gssrpc_svcudp_bufcreate +#define svcudp_enablecache gssrpc_svcudp_enablecache + +#define svctcp_create gssrpc_svctcp_create + +#define svcfd_create gssrpc_svcfd_create + +/* svc_auth.h */ + +#define svc_auth_none_ops gssrpc_svc_auth_none_ops +#define svc_auth_gssapi_ops gssrpc_svc_auth_gssapi_ops +#define svc_auth_gss_ops gssrpc_svc_auth_gss_ops + +#define svcauth_gss_set_svc_name gssrpc_svcauth_gss_set_svc_name +#define svcauth_gss_get_principal gssrpc_svcauth_gss_get_principal + +/* svc_auth_gss.c */ + +#define svc_debug_gss gssrpc_svc_debug_gss + +/* svc_auth_gssapi.c */ + +#define svc_debug_gssapi gssrpc_svc_debug_gssapi + +/* svc_auth_none.c */ + +#define svc_auth_none gssrpc_svc_auth_none + +/* xdr.h */ + +#define xdr_void gssrpc_xdr_void +#define xdr_int gssrpc_xdr_int +#define xdr_u_int gssrpc_xdr_u_int +#define xdr_long gssrpc_xdr_long +#define xdr_u_long gssrpc_xdr_u_long +#define xdr_short gssrpc_xdr_short +#define xdr_u_short gssrpc_xdr_u_short +#define xdr_bool gssrpc_xdr_bool +#define xdr_enum gssrpc_xdr_enum +#define xdr_array gssrpc_xdr_array +#define xdr_bytes gssrpc_xdr_bytes +#define xdr_opaque gssrpc_xdr_opaque +#define xdr_string gssrpc_xdr_string +#define xdr_union gssrpc_xdr_union +#define xdr_char gssrpc_xdr_char +#define xdr_u_char gssrpc_xdr_u_char +#define xdr_vector gssrpc_xdr_vector +#define xdr_float gssrpc_xdr_float +#define xdr_double gssrpc_xdr_double +#define xdr_reference gssrpc_xdr_reference +#define xdr_pointer gssrpc_xdr_pointer +#define xdr_wrapstring gssrpc_xdr_wrapstring +#define xdr_free gssrpc_xdr_free + +#define xdr_sizeof gssrpc_xdr_sizeof + +#define xdr_netobj gssrpc_xdr_netobj +#define xdr_int32 gssrpc_xdr_int32 +#define xdr_u_int32 gssrpc_xdr_u_int32 + +#define xdralloc_create gssrpc_xdralloc_create +#define xdralloc_release gssrpc_xdralloc_release +#define xdralloc_getdata gssrpc_xdralloc_getdata + +#define xdrmem_create gssrpc_xdrmem_create +#define xdrstdio_create gssrpc_xdrstdio_create +#define xdrrec_create gssrpc_xdrrec_create +#define xdrrec_endofrecord gssrpc_xdrrec_endofrecord +#define xdrrec_skiprecord gssrpc_xdrrec_skiprecord +#define xdrrec_eof gssrpc_xdrrec_eof + +#endif /* !defined(GSSRPC_RENAME_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc.h new file mode 100644 index 0000000000000000000000000000000000000000..78727c49d39e1180e091cca950e336fe3d8d60fd --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc.h @@ -0,0 +1,77 @@ +/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * rpc.h, Just includes the billions of rpc header files necessary to + * do remote procedure calling. + */ +#ifndef GSSRPC_RPC_H +#define GSSRPC_RPC_H + +#include /* some typedefs */ +#include + +/* external data representation interfaces */ +#include /* generic (de)serializer */ + +/* Client side only authentication */ +#include /* generic authenticator (client side) */ + +/* Client side (mostly) remote procedure call */ +#include /* generic rpc stuff */ + +/* semi-private protocol headers */ +#include /* protocol for rpc messages */ +#include /* protocol for unix style cred */ +#include /* RPCSEC_GSS */ + +/* Server side only remote procedure callee */ +#include /* service side authenticator */ +#include /* service manager and multiplexer */ + +/* + * get the local host's IP address without consulting + * name service library functions + */ +GSSRPC__BEGIN_DECLS +extern int get_myaddress(struct sockaddr_in *); +extern int bindresvport(int, struct sockaddr_in *); +extern int bindresvport_sa(int, struct sockaddr *); +extern int callrpc(char *, rpcprog_t, rpcvers_t, rpcproc_t, xdrproc_t, + char *, xdrproc_t , char *); +extern int getrpcport(char *, rpcprog_t, rpcvers_t, rpcprot_t); +extern int gssrpc__rpc_dtablesize(void); +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_RPC_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc_msg.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc_msg.h new file mode 100644 index 0000000000000000000000000000000000000000..9403bfc1fcca1fdea8e77b99f354774ea678a0dc --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/rpc_msg.h @@ -0,0 +1,207 @@ +/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ +/* @(#)rpc_msg.h 1.7 86/07/16 SMI */ + +/* + * rpc_msg.h + * rpc message definition + */ + +#ifndef GSSRPC_RPC_MSG_H +#define GSSRPC_RPC_MSG_H + +GSSRPC__BEGIN_DECLS + +#define RPC_MSG_VERSION ((uint32_t) 2) +#define RPC_SERVICE_PORT ((u_short) 2048) + +/* + * Bottom up definition of an rpc message. + * NOTE: call and reply use the same overall struct but + * different parts of unions within it. + */ + +enum msg_type { + CALL=0, + REPLY=1 +}; + +enum reply_stat { + MSG_ACCEPTED=0, + MSG_DENIED=1 +}; + +enum accept_stat { + SUCCESS=0, + PROG_UNAVAIL=1, + PROG_MISMATCH=2, + PROC_UNAVAIL=3, + GARBAGE_ARGS=4, + SYSTEM_ERR=5 +}; + +enum reject_stat { + RPC_MISMATCH=0, + AUTH_ERROR=1 +}; + +/* + * Reply part of an rpc exchange + */ + +/* + * Reply to an rpc request that was accepted by the server. + * Note: there could be an error even though the request was + * accepted. + */ +struct accepted_reply { + struct opaque_auth ar_verf; + enum accept_stat ar_stat; + union { + struct { + rpcvers_t low; + rpcvers_t high; + } AR_versions; + struct { + caddr_t where; + xdrproc_t proc; + } AR_results; + /* and many other null cases */ + } ru; +#define ar_results ru.AR_results +#define ar_vers ru.AR_versions +}; + +/* + * Reply to an rpc request that was rejected by the server. + */ +struct rejected_reply { + enum reject_stat rj_stat; + union { + struct { + rpcvers_t low; + rpcvers_t high; + } RJ_versions; + enum auth_stat RJ_why; /* why authentication did not work */ + } ru; +#define rj_vers ru.RJ_versions +#define rj_why ru.RJ_why +}; + +/* + * Body of a reply to an rpc request. + */ +struct reply_body { + enum reply_stat rp_stat; + union { + struct accepted_reply RP_ar; + struct rejected_reply RP_dr; + } ru; +#define rp_acpt ru.RP_ar +#define rp_rjct ru.RP_dr +}; + +/* + * Body of an rpc request call. + */ +struct call_body { + rpcvers_t cb_rpcvers; /* must be equal to two */ + rpcprog_t cb_prog; + rpcvers_t cb_vers; + rpcproc_t cb_proc; + struct opaque_auth cb_cred; + struct opaque_auth cb_verf; /* protocol specific - provided by client */ +}; + +/* + * The rpc message + */ +struct rpc_msg { + uint32_t rm_xid; + enum msg_type rm_direction; + union { + struct call_body RM_cmb; + struct reply_body RM_rmb; + } ru; +#define rm_call ru.RM_cmb +#define rm_reply ru.RM_rmb +}; +#define acpted_rply ru.RM_rmb.ru.RP_ar +#define rjcted_rply ru.RM_rmb.ru.RP_dr + + +/* + * XDR routine to handle a rpc message. + * xdr_callmsg(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callmsg(XDR *, struct rpc_msg *); + +/* + * XDR routine to pre-serialize the static part of a rpc message. + * xdr_callhdr(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); + +/* + * XDR routine to handle a rpc reply. + * xdr_replymsg(xdrs, rmsg) + * XDR *xdrs; + * struct rpc_msg *rmsg; + */ +extern bool_t xdr_replymsg(XDR *, struct rpc_msg *); + +/* + * Fills in the error part of a reply message. + * _seterr_reply(msg, error) + * struct rpc_msg *msg; + * struct rpc_err *error; + */ +/* + * RENAMED: should be _seterr_reply or __seterr_reply if we can use + * reserved namespace. + */ +extern void gssrpc__seterr_reply(struct rpc_msg *, struct rpc_err *); + +/* XDR the MSG_ACCEPTED part of a reply message union */ +extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); + +/* XDR the MSG_DENIED part of a reply message union */ +extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_RPC_MSG_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc.h new file mode 100644 index 0000000000000000000000000000000000000000..6ef52b95bbc953f712d5aee5eb919a1d6815ab92 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc.h @@ -0,0 +1,336 @@ +/* @(#)svc.h 2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ + +/* + * svc.h, Server-side remote procedure call interface. + */ + +#ifndef GSSRPC_SVC_H +#define GSSRPC_SVC_H + +#include + +GSSRPC__BEGIN_DECLS +/* + * This interface must manage two items concerning remote procedure calling: + * + * 1) An arbitrary number of transport connections upon which rpc requests + * are received. The two most notable transports are TCP and UDP; they are + * created and registered by routines in svc_tcp.c and svc_udp.c, respectively; + * they in turn call xprt_register and xprt_unregister. + * + * 2) An arbitrary number of locally registered services. Services are + * described by the following four data: program number, version number, + * "service dispatch" function, a transport handle, and a boolean that + * indicates whether or not the exported program should be registered with a + * local binder service; if true the program's number and version and the + * port number from the transport handle are registered with the binder. + * These data are registered with the rpc svc system via svc_register. + * + * A service's dispatch function is called whenever an rpc request comes in + * on a transport. The request's program and version numbers must match + * those of the registered service. The dispatch function is passed two + * parameters, struct svc_req * and SVCXPRT *, defined below. + */ + +enum xprt_stat { + XPRT_DIED, + XPRT_MOREREQS, + XPRT_IDLE +}; + +/* + * Server side transport handle + */ +typedef struct SVCXPRT { +#ifdef _WIN32 + SOCKET xp_sock; +#else + int xp_sock; +#endif + u_short xp_port; /* associated port number */ + struct xp_ops { + /* receive incoming requests */ + bool_t (*xp_recv)(struct SVCXPRT *, struct rpc_msg *); + /* get transport status */ + enum xprt_stat (*xp_stat)(struct SVCXPRT *); + /* get arguments */ + bool_t (*xp_getargs)(struct SVCXPRT *, xdrproc_t, + void *); + /* send reply */ + bool_t (*xp_reply)(struct SVCXPRT *, + struct rpc_msg *); + /* free mem allocated for args */ + bool_t (*xp_freeargs)(struct SVCXPRT *, xdrproc_t, + void *); + /* destroy this struct */ + void (*xp_destroy)(struct SVCXPRT *); + } *xp_ops; + int xp_addrlen; /* length of remote address */ + struct sockaddr_in xp_raddr; /* remote address */ + struct opaque_auth xp_verf; /* raw response verifier */ + SVCAUTH *xp_auth; /* auth flavor of current req */ + void *xp_p1; /* private */ + void *xp_p2; /* private */ + int xp_laddrlen; /* length of local address */ + struct sockaddr_in xp_laddr; /* local address */ +} SVCXPRT; + +/* + * Approved way of getting address of caller + */ +#define svc_getcaller(x) (&(x)->xp_raddr) + +/* + * Operations defined on an SVCXPRT handle + * + * SVCXPRT *xprt; + * struct rpc_msg *msg; + * xdrproc_t xargs; + * caddr_t argsp; + */ +#define SVC_RECV(xprt, msg) \ + (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) +#define svc_recv(xprt, msg) \ + (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) + +#define SVC_STAT(xprt) \ + (*(xprt)->xp_ops->xp_stat)(xprt) +#define svc_stat(xprt) \ + (*(xprt)->xp_ops->xp_stat)(xprt) + +#define SVC_GETARGS(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) +#define svc_getargs(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) + +#define SVC_GETARGS_REQ(xprt, req, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs_req)((xprt), (req), (xargs), (argsp)) +#define svc_getargs_req(xprt, req, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs_req)((xprt), (req), (xargs), (argsp)) + +#define SVC_REPLY(xprt, msg) \ + (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) +#define svc_reply(xprt, msg) \ + (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) + +#define SVC_REPLY_REQ(xprt, req, msg) \ + (*(xprt)->xp_ops->xp_reply_req) ((xprt), (req), (msg)) +#define svc_reply_req(xprt, msg) \ + (*(xprt)->xp_ops->xp_reply_req) ((xprt), (req), (msg)) + +#define SVC_FREEARGS(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) +#define svc_freeargs(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) + +#define SVC_DESTROY(xprt) \ + (*(xprt)->xp_ops->xp_destroy)(xprt) +#define svc_destroy(xprt) \ + (*(xprt)->xp_ops->xp_destroy)(xprt) + + +/* + * Service request + */ +struct svc_req { + rpcprog_t rq_prog; /* service program number */ + rpcvers_t rq_vers; /* service protocol version */ + rpcproc_t rq_proc; /* the desired procedure */ + struct opaque_auth rq_cred; /* raw creds from the wire */ + void * rq_clntcred; /* read only cooked client cred */ + void * rq_svccred; /* read only svc cred/context */ + void * rq_clntname; /* read only client name */ + SVCXPRT *rq_xprt; /* associated transport */ + /* The request's auth flavor *should* be here, but the svc_req */ + /* isn't passed around everywhere it is necessary. The */ + /* transport *is* passed around, so the auth flavor it stored */ + /* there. This means that the transport must be single */ + /* threaded, but other parts of SunRPC already require that. */ + /*SVCAUTH *rq_auth; associated auth flavor */ +}; + + +/* + * Service registration + * + * svc_register(xprt, prog, vers, dispatch, protocol) + * SVCXPRT *xprt; + * rpcprog_t prog; + * rpcvers_t vers; + * void (*dispatch)(); + * int protocol; like IPPROTO_TCP or _UDP; zero means do not register + * + * registerrpc(prog, vers, proc, routine, inproc, outproc) + * returns 0 upon success, -1 if error. + */ +extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, + void (*)(struct svc_req *, SVCXPRT *), int); + +extern int registerrpc(rpcprog_t, rpcvers_t, rpcproc_t, + char *(*)(void *), + xdrproc_t, xdrproc_t); + +/* + * Service un-registration + * + * svc_unregister(prog, vers) + * rpcprog_t prog; + * rpcvers_t vers; + */ +extern void svc_unregister(rpcprog_t, rpcvers_t); + +/* + * Transport registration. + * + * xprt_register(xprt) + * SVCXPRT *xprt; + */ +extern void xprt_register(SVCXPRT *); + +/* + * Transport un-register + * + * xprt_unregister(xprt) + * SVCXPRT *xprt; + */ +extern void xprt_unregister(SVCXPRT *); + + +/* + * When the service routine is called, it must first check to see if + * it knows about the procedure; if not, it should call svcerr_noproc + * and return. If so, it should deserialize its arguments via + * SVC_GETARGS or the new SVC_GETARGS_REQ (both defined above). If + * the deserialization does not work, svcerr_decode should be called + * followed by a return. Successful decoding of the arguments should + * be followed the execution of the procedure's code and a call to + * svc_sendreply or the new svc_sendreply_req. + * + * Also, if the service refuses to execute the procedure due to too- + * weak authentication parameters, svcerr_weakauth should be called. + * Note: do not confuse access-control failure with weak authentication! + * + * NB: In pure implementations of rpc, the caller always waits for a reply + * msg. This message is sent when svc_sendreply is called. + * Therefore pure service implementations should always call + * svc_sendreply even if the function logically returns void; use + * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows + * for the abuse of pure rpc via batched calling or pipelining. In the + * case of a batched call, svc_sendreply should NOT be called since + * this would send a return message, which is what batching tries to avoid. + * It is the service/protocol writer's responsibility to know which calls are + * batched and which are not. Warning: responding to batch calls may + * deadlock the caller and server processes! + */ + +extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); +extern void svcerr_decode(SVCXPRT *); +extern void svcerr_weakauth(SVCXPRT *); +extern void svcerr_noproc(SVCXPRT *); +extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); +extern void svcerr_auth(SVCXPRT *, enum auth_stat); +extern void svcerr_noprog(SVCXPRT *); +extern void svcerr_systemerr(SVCXPRT *); + +/* + * Lowest level dispatching -OR- who owns this process anyway. + * Somebody has to wait for incoming requests and then call the correct + * service routine. The routine svc_run does infinite waiting; i.e., + * svc_run never returns. + * Since another (co-existant) package may wish to selectively wait for + * incoming calls or other events outside of the rpc architecture, the + * routine svc_getreq is provided. It must be passed readfds, the + * "in-place" results of a select system call (see select, section 2). + */ + +/* + * Global keeper of rpc service descriptors in use + * dynamic; must be inspected before each call to select + */ +extern int svc_maxfd; +#ifdef FD_SETSIZE +extern fd_set svc_fdset; +/* RENAMED */ +#define gssrpc_svc_fds gsssrpc_svc_fdset.fds_bits[0] /* compatibility */ +#else +extern int svc_fds; +#endif /* def FD_SETSIZE */ +extern int svc_maxfd; + +extern void svc_getreq(int); +#ifdef FD_SETSIZE +extern void svc_getreqset(fd_set *);/* takes fdset instead of int */ +#else +extern void svc_getreqset(int *); +#endif +extern void svc_run(void); /* never returns */ + +/* + * Socket to use on svcxxx_create call to get default socket + */ +#define RPC_ANYSOCK -1 + +/* + * These are the existing service side transport implementations + */ + +/* + * Memory based rpc for testing and timing. + */ +extern SVCXPRT *svcraw_create(void); + +/* + * Udp based rpc. + */ +extern SVCXPRT *svcudp_create(int); +extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); +extern int svcudp_enablecache(SVCXPRT *, uint32_t); + +/* + * Tcp based rpc. + */ +extern SVCXPRT *svctcp_create(int, u_int, u_int); + +/* + * Like svtcp_create(), except the routine takes any *open* UNIX file + * descriptor as its first input. + */ +extern SVCXPRT *svcfd_create(int, u_int, u_int); + +/* XXX add auth_gsapi_log_*? */ + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_SVC_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc_auth.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc_auth.h new file mode 100644 index 0000000000000000000000000000000000000000..45853747d7490fa0558741542c5cb854fb14d414 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/svc_auth.h @@ -0,0 +1,119 @@ +/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ +/* @(#)svc_auth.h 1.6 86/07/16 SMI */ + +/* + * svc_auth.h, Service side of rpc authentication. + */ + +/* + * Interface to server-side authentication flavors. + */ + +#ifndef GSSRPC_SVC_AUTH_H +#define GSSRPC_SVC_AUTH_H + +#include + +GSSRPC__BEGIN_DECLS + +struct svc_req; + +typedef struct SVCAUTH { + struct svc_auth_ops { + int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t, + caddr_t); + int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t, + caddr_t); + int (*svc_ah_destroy)(struct SVCAUTH *); + } *svc_ah_ops; + void * svc_ah_private; +} SVCAUTH; + +#ifdef GSSRPC__IMPL + +extern SVCAUTH svc_auth_none; + +extern struct svc_auth_ops svc_auth_none_ops; +extern struct svc_auth_ops svc_auth_gssapi_ops; +extern struct svc_auth_ops svc_auth_gss_ops; + +/* + * Server side authenticator + */ +/* RENAMED: should be _authenticate. */ +extern enum auth_stat gssrpc__authenticate(struct svc_req *rqst, + struct rpc_msg *msg, bool_t *no_dispatch); + +#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere)) +#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere)) +#define SVCAUTH_DESTROY(auth) \ + ((*((auth)->svc_ah_ops->svc_ah_destroy))(auth)) + +/* no authentication */ +/* RENAMED: should be _svcauth_none. */ +enum auth_stat gssrpc__svcauth_none(struct svc_req *, + struct rpc_msg *, bool_t *); +/* unix style (uid, gids) */ +/* RENAMED: should be _svcauth_unix. */ +enum auth_stat gssrpc__svcauth_unix(struct svc_req *, + struct rpc_msg *, bool_t *); +/* short hand unix style */ +/* RENAMED: should be _svcauth_short. */ +enum auth_stat gssrpc__svcauth_short(struct svc_req *, + struct rpc_msg *, bool_t *); +/* GSS-API style */ +/* RENAMED: should be _svcauth_gssapi. */ +enum auth_stat gssrpc__svcauth_gssapi(struct svc_req *, + struct rpc_msg *, bool_t *); +/* RPCSEC_GSS */ +enum auth_stat gssrpc__svcauth_gss(struct svc_req *, + struct rpc_msg *, bool_t *); + +#endif /* defined(GSSRPC__IMPL) */ + +/* + * Approved way of getting principal of caller + */ +char *svcauth_gss_get_principal(SVCAUTH *auth); +/* + * Approved way of setting server principal + */ +bool_t svcauth_gss_set_svc_name(gss_name_t name); + +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_SVC_AUTH_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/types.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/types.h new file mode 100644 index 0000000000000000000000000000000000000000..7cc2dd267547842d776d1a47991474040e7c7a49 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/types.h @@ -0,0 +1,130 @@ +/* @(#)types.h 2.3 88/08/15 4.0 RPCSRC */ +/* + * Copyright (c) 2010, Oracle America, 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 of the “Oracle America, Inc.” 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. + */ +/* @(#)types.h 1.18 87/07/24 SMI */ + +/* + * Rpc additions to + */ +#ifndef GSSRPC_TYPES_H +#define GSSRPC_TYPES_H + +#include + +#include +#include +#include + +/* + * Try to get MAXHOSTNAMELEN from somewhere. + */ +#include +/* #include */ + +/* Get htonl(), ntohl(), etc. */ +#include + +#include +#include +#include + +#ifndef GSSRPC__BEGIN_DECLS +#ifdef __cplusplus +#define GSSRPC__BEGIN_DECLS extern "C" { +#define GSSRPC__END_DECLS } +#else +#define GSSRPC__BEGIN_DECLS +#define GSSRPC__END_DECLS +#endif +#endif + +GSSRPC__BEGIN_DECLS + +#if defined(CHAR_BIT) && CHAR_BIT != 8 +#error "Bytes must be exactly 8 bits." +#endif + +/* Define if we need to fake up some BSD type aliases. */ +#ifndef GSSRPC__BSD_TYPEALIASES /* Allow application to override. */ +/* #undef GSSRPC__BSD_TYPEALIASES */ +#endif +#if GSSRPC__BSD_TYPEALIASES +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; +#endif + +typedef uint32_t rpcprog_t; +typedef uint32_t rpcvers_t; +typedef uint32_t rpcprot_t; +typedef uint32_t rpcproc_t; +typedef uint32_t rpcport_t; +typedef int32_t rpc_inline_t; + +/* This is for rpc/netdb.h */ +#define STRUCT_RPCENT_IN_RPC_NETDB_H + +typedef int bool_t; +typedef int enum_t; +#ifndef FALSE +# define FALSE (0) +#endif +#ifndef TRUE +# define TRUE (1) +#endif +/* XXX namespace */ +#define __dontcare__ -1 +#ifndef NULL +# define NULL 0 +#endif + +/* + * The below should probably be internal-only, but seem to be + * traditionally exported in RPC implementations. + */ +#define mem_alloc(bsize) malloc(bsize) +#define mem_free(ptr, bsize) free(ptr) + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK (uint32_t)0x7F000001 +#endif +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + +GSSRPC__END_DECLS + +#include + +#endif /* !defined(GSSRPC_TYPES_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/xdr.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/xdr.h new file mode 100644 index 0000000000000000000000000000000000000000..4e5c29bdc2db15f96c416f13e7b7746a3ce6f130 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/gssrpc/xdr.h @@ -0,0 +1,339 @@ +/* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC */ +/* + * Copyright (c) 2010, Oracle America, 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 of the "Oracle America, Inc." 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. + */ +/* @(#)xdr.h 1.19 87/04/22 SMI */ + +/* + * xdr.h, External Data Representation Serialization Routines. + */ + +#ifndef GSSRPC_XDR_H +#define GSSRPC_XDR_H + +#include /* for FILE */ + +GSSRPC__BEGIN_DECLS +/* + * XDR provides a conventional way for converting between C data + * types and an external bit-string representation. Library supplied + * routines provide for the conversion on built-in C data types. These + * routines and utility routines defined here are used to help implement + * a type encode/decode routine for each user-defined type. + * + * Each data type provides a single procedure which takes two arguments: + * + * bool_t + * xdrproc(xdrs, argresp) + * XDR *xdrs; + * *argresp; + * + * xdrs is an instance of a XDR handle, to which or from which the data + * type is to be converted. argresp is a pointer to the structure to be + * converted. The XDR handle contains an operation field which indicates + * which of the operations (ENCODE, DECODE * or FREE) is to be performed. + * + * XDR_DECODE may allocate space if the pointer argresp is null. This + * data can be freed with the XDR_FREE operation. + * + * We write only one procedure per data type to make it easy + * to keep the encode and decode procedures for a data type consistent. + * In many cases the same code performs all operations on a user defined type, + * because all the hard work is done in the component type routines. + * decode as a series of calls on the nested data types. + */ + +/* + * Xdr operations. XDR_ENCODE causes the type to be encoded into the + * stream. XDR_DECODE causes the type to be extracted from the stream. + * XDR_FREE can be used to release the space allocated by an XDR_DECODE + * request. + */ +enum xdr_op { + XDR_ENCODE=0, + XDR_DECODE=1, + XDR_FREE=2 +}; + +/* + * This is the number of bytes per unit of external data. + */ +#define BYTES_PER_XDR_UNIT (4) +#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ + * BYTES_PER_XDR_UNIT) + +/* + * A xdrproc_t exists for each data type which is to be encoded or decoded. + * + * The second argument to the xdrproc_t is a pointer to an opaque pointer. + * The opaque pointer generally points to a structure of the data type + * to be decoded. If this pointer is 0, then the type routines should + * allocate dynamic storage of the appropriate size and return it. + * bool_t (*xdrproc_t)(XDR *, caddr_t *); + * + * XXX can't actually prototype it, because some take three args!!! + */ + +/* + * The XDR handle. + * Contains operation which is being applied to the stream, + * an operations vector for the particular implementation (e.g. see xdr_mem.c), + * and two private fields for the use of the particular impelementation. + */ +typedef struct XDR { + enum xdr_op x_op; /* operation; fast additional param */ + struct xdr_ops { + /* get a long from underlying stream */ + bool_t (*x_getlong)(struct XDR *, long *); + + /* put a long to underlying stream */ + bool_t (*x_putlong)(struct XDR *, long *); + + /* get some bytes from underlying stream */ + bool_t (*x_getbytes)(struct XDR *, caddr_t, u_int); + + /* put some bytes to underlying stream */ + bool_t (*x_putbytes)(struct XDR *, caddr_t, u_int); + + /* returns bytes off from beginning */ + u_int (*x_getpostn)(struct XDR *); + + /* lets you reposition the stream */ + bool_t (*x_setpostn)(struct XDR *, u_int); + + /* buf quick ptr to buffered data */ + rpc_inline_t *(*x_inline)(struct XDR *, int); + + /* free privates of this xdr_stream */ + void (*x_destroy)(struct XDR *); + } *x_ops; + caddr_t x_public; /* users' data */ + void * x_private; /* pointer to private data */ + caddr_t x_base; /* private used for position info */ + int x_handy; /* extra private word */ +} XDR; + +typedef bool_t (*xdrproc_t)(XDR *, void *); + +/* + * Operations defined on a XDR handle + * + * XDR *xdrs; + * int32_t *longp; + * caddr_t addr; + * u_int len; + * u_int pos; + */ +#define XDR_GETLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) +#define xdr_getlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) + +#define XDR_PUTLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) +#define xdr_putlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) + +#define XDR_GETBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) +#define xdr_getbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) + +#define XDR_PUTBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) +#define xdr_putbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) + +#define XDR_GETPOS(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) +#define xdr_getpos(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) + +#define XDR_SETPOS(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) +#define xdr_setpos(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) + +#define XDR_INLINE(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) +#define xdr_inline(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) + +#define XDR_DESTROY(xdrs) \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs) +#define xdr_destroy(xdrs) \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs) + +/* + * Support struct for discriminated unions. + * You create an array of xdrdiscrim structures, terminated with + * a entry with a null procedure pointer. The xdr_union routine gets + * the discriminant value and then searches the array of structures + * for a matching value. If a match is found the associated xdr routine + * is called to handle that part of the union. If there is + * no match, then a default routine may be called. + * If there is no match and no default routine it is an error. + */ +#define NULL_xdrproc_t ((xdrproc_t)0) +struct xdr_discrim { + int value; + xdrproc_t proc; +}; + +/* + * In-line routines for fast encode/decode of primitive data types. + * Caveat emptor: these use single memory cycles to get the + * data from the underlying buffer, and will fail to operate + * properly if the data is not aligned. The standard way to use these + * is to say: + * if ((buf = XDR_INLINE(xdrs, count)) == NULL) + * return (FALSE); + * <<< macro calls >>> + * where ``count'' is the number of bytes of data occupied + * by the primitive data types. + * + * N.B. and frozen for all time: each data type here uses 4 bytes + * of external representation. + */ +#define IXDR_GET_INT32(buf) ((int32_t)IXDR_GET_U_INT32(buf)) +#define IXDR_PUT_INT32(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) +#define IXDR_GET_U_INT32(buf) (ntohl((uint32_t)*(buf)++)) +#define IXDR_PUT_U_INT32(buf, v) (*(buf)++ = (int32_t)htonl((v))) + +#define IXDR_GET_LONG(buf) ((long)IXDR_GET_INT32(buf)) +#define IXDR_PUT_LONG(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) + +#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) +#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_INT32(buf)) +#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_U_INT32(buf)) +#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_INT32(buf)) +#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_U_INT32(buf)) + +#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) +#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) +#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) +#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) +#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) + +/* + * These are the "generic" xdr routines. + */ +extern bool_t xdr_void(XDR *, void *); +extern bool_t xdr_int(XDR *, int *); +extern bool_t xdr_u_int(XDR *, u_int *); +extern bool_t xdr_long(XDR *, long *); +extern bool_t xdr_u_long(XDR *, u_long *); +extern bool_t xdr_short(XDR *, short *); +extern bool_t xdr_u_short(XDR *, u_short *); +extern bool_t xdr_bool(XDR *, bool_t *); +extern bool_t xdr_enum(XDR *, enum_t *); +extern bool_t xdr_array(XDR *, caddr_t *, u_int *, + u_int, u_int, xdrproc_t); +extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); +extern bool_t xdr_opaque(XDR *, caddr_t, u_int); +extern bool_t xdr_string(XDR *, char **, u_int); +extern bool_t xdr_union(XDR *, enum_t *, char *, struct xdr_discrim *, + xdrproc_t); +extern bool_t xdr_char(XDR *, char *); +extern bool_t xdr_u_char(XDR *, u_char *); +extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); +extern bool_t xdr_float(XDR *, float *); +extern bool_t xdr_double(XDR *, double *); +extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); +extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); +extern bool_t xdr_wrapstring(XDR *, char **); + +extern unsigned long xdr_sizeof(xdrproc_t, void *); + +#define xdr_rpcprog xdr_u_int32 +#define xdr_rpcvers xdr_u_int32 +#define xdr_rpcprot xdr_u_int32 +#define xdr_rpcproc xdr_u_int32 +#define xdr_rpcport xdr_u_int32 + +/* + * Common opaque bytes objects used by many rpc protocols; + * declared here due to commonality. + */ +#define MAX_NETOBJ_SZ 2048 +struct netobj { + u_int n_len; + char *n_bytes; +}; +typedef struct netobj netobj; + +extern bool_t xdr_netobj(XDR *, struct netobj *); + +extern bool_t xdr_int32(XDR *, int32_t *); +extern bool_t xdr_u_int32(XDR *, uint32_t *); + +/* + * These are the public routines for the various implementations of + * xdr streams. + */ + +/* XDR allocating memory buffer */ +extern void xdralloc_create(XDR *, enum xdr_op); + +/* destroy xdralloc, save buf */ +extern void xdralloc_release(XDR *); + +/* get buffer from xdralloc */ +extern caddr_t xdralloc_getdata(XDR *); + +/* XDR using memory buffers */ +extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); + +/* XDR using stdio library */ +extern void xdrstdio_create(XDR *, FILE *, enum xdr_op); + +/* XDR pseudo records for tcp */ +extern void xdrrec_create(XDR *xdrs, u_int, u_int, caddr_t, + int (*) (caddr_t, caddr_t, int), + int (*) (caddr_t, caddr_t, int)); + +/* make end of xdr record */ +extern bool_t xdrrec_endofrecord(XDR *, bool_t); + +/* move to beginning of next record */ +extern bool_t xdrrec_skiprecord (XDR *xdrs); + +/* true if no more input */ +extern bool_t xdrrec_eof (XDR *xdrs); + +/* free memory buffers for xdr */ +extern void xdr_free (xdrproc_t, void *); +GSSRPC__END_DECLS + +#endif /* !defined(GSSRPC_XDR_H) */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/admin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/admin.h new file mode 100644 index 0000000000000000000000000000000000000000..3a0c389a5a0a283f723c8a1785dcfc566c9433b6 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/admin.h @@ -0,0 +1,503 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* lib/kadm5/admin.h */ +/* + * Copyright 2001, 2008 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ +/* + * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved + * + * $Header$ + */ + +/* + * This API is not considered as stable as the main krb5 API. + * + * - We may make arbitrary incompatible changes between feature + * releases (e.g. from 1.7 to 1.8). + * - We will make some effort to avoid making incompatible changes for + * bugfix releases, but will make them if necessary. + */ + +#ifndef __KADM5_ADMIN_H__ +#define __KADM5_ADMIN_H__ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef KADM5INT_BEGIN_DECLS +#if defined(__cplusplus) +#define KADM5INT_BEGIN_DECLS extern "C" { +#define KADM5INT_END_DECLS } +#else +#define KADM5INT_BEGIN_DECLS +#define KADM5INT_END_DECLS +#endif +#endif + +KADM5INT_BEGIN_DECLS + +#define KADM5_ADMIN_SERVICE "kadmin/admin" +#define KADM5_CHANGEPW_SERVICE "kadmin/changepw" +#define KADM5_HIST_PRINCIPAL "kadmin/history" +#define KADM5_KIPROP_HOST_SERVICE "kiprop" + +typedef krb5_principal kadm5_princ_t; +typedef char *kadm5_policy_t; +typedef long kadm5_ret_t; + +#define KADM5_PW_FIRST_PROMPT \ + (error_message(CHPASS_UTIL_NEW_PASSWORD_PROMPT)) +#define KADM5_PW_SECOND_PROMPT \ + (error_message(CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT)) + +/* + * Successful return code + */ +#define KADM5_OK 0 + +/* + * Field masks + */ + +/* kadm5_principal_ent_t */ +#define KADM5_PRINCIPAL 0x000001 +#define KADM5_PRINC_EXPIRE_TIME 0x000002 +#define KADM5_PW_EXPIRATION 0x000004 +#define KADM5_LAST_PWD_CHANGE 0x000008 +#define KADM5_ATTRIBUTES 0x000010 +#define KADM5_MAX_LIFE 0x000020 +#define KADM5_MOD_TIME 0x000040 +#define KADM5_MOD_NAME 0x000080 +#define KADM5_KVNO 0x000100 +#define KADM5_MKVNO 0x000200 +#define KADM5_AUX_ATTRIBUTES 0x000400 +#define KADM5_POLICY 0x000800 +#define KADM5_POLICY_CLR 0x001000 +/* version 2 masks */ +#define KADM5_MAX_RLIFE 0x002000 +#define KADM5_LAST_SUCCESS 0x004000 +#define KADM5_LAST_FAILED 0x008000 +#define KADM5_FAIL_AUTH_COUNT 0x010000 +#define KADM5_KEY_DATA 0x020000 +#define KADM5_TL_DATA 0x040000 +#ifdef notyet /* Novell */ +#define KADM5_CPW_FUNCTION 0x080000 +#define KADM5_RANDKEY_USED 0x100000 +#endif +#define KADM5_LOAD 0x200000 +#define KADM5_KEY_HIST 0x400000 + +/* all but KEY_DATA, TL_DATA, LOAD */ +#define KADM5_PRINCIPAL_NORMAL_MASK 0x41ffff + + +/* kadm5_policy_ent_t */ +#define KADM5_PW_MAX_LIFE 0x00004000 +#define KADM5_PW_MIN_LIFE 0x00008000 +#define KADM5_PW_MIN_LENGTH 0x00010000 +#define KADM5_PW_MIN_CLASSES 0x00020000 +#define KADM5_PW_HISTORY_NUM 0x00040000 +#define KADM5_REF_COUNT 0x00080000 +#define KADM5_PW_MAX_FAILURE 0x00100000 +#define KADM5_PW_FAILURE_COUNT_INTERVAL 0x00200000 +#define KADM5_PW_LOCKOUT_DURATION 0x00400000 +#define KADM5_POLICY_ATTRIBUTES 0x00800000 +#define KADM5_POLICY_MAX_LIFE 0x01000000 +#define KADM5_POLICY_MAX_RLIFE 0x02000000 +#define KADM5_POLICY_ALLOWED_KEYSALTS 0x04000000 +#define KADM5_POLICY_TL_DATA 0x08000000 + +/* kadm5_config_params */ +#define KADM5_CONFIG_REALM 0x00000001 +#define KADM5_CONFIG_DBNAME 0x00000002 +#define KADM5_CONFIG_MKEY_NAME 0x00000004 +#define KADM5_CONFIG_MAX_LIFE 0x00000008 +#define KADM5_CONFIG_MAX_RLIFE 0x00000010 +#define KADM5_CONFIG_EXPIRATION 0x00000020 +#define KADM5_CONFIG_FLAGS 0x00000040 +/*#define KADM5_CONFIG_ADMIN_KEYTAB 0x00000080*/ +#define KADM5_CONFIG_STASH_FILE 0x00000100 +#define KADM5_CONFIG_ENCTYPE 0x00000200 +#define KADM5_CONFIG_ADBNAME 0x00000400 +#define KADM5_CONFIG_ADB_LOCKFILE 0x00000800 +#define KADM5_CONFIG_KADMIND_LISTEN 0x00001000 +#define KADM5_CONFIG_ACL_FILE 0x00002000 +#define KADM5_CONFIG_KADMIND_PORT 0x00004000 +#define KADM5_CONFIG_ENCTYPES 0x00008000 +#define KADM5_CONFIG_ADMIN_SERVER 0x00010000 +#define KADM5_CONFIG_DICT_FILE 0x00020000 +#define KADM5_CONFIG_MKEY_FROM_KBD 0x00040000 +#define KADM5_CONFIG_KPASSWD_PORT 0x00080000 +#define KADM5_CONFIG_OLD_AUTH_GSSAPI 0x00100000 +#define KADM5_CONFIG_NO_AUTH 0x00200000 +#define KADM5_CONFIG_AUTH_NOFALLBACK 0x00400000 +#define KADM5_CONFIG_KPASSWD_LISTEN 0x00800000 +#define KADM5_CONFIG_IPROP_ENABLED 0x01000000 +#define KADM5_CONFIG_ULOG_SIZE 0x02000000 +#define KADM5_CONFIG_POLL_TIME 0x04000000 +#define KADM5_CONFIG_IPROP_LOGFILE 0x08000000 +#define KADM5_CONFIG_IPROP_PORT 0x10000000 +#define KADM5_CONFIG_KVNO 0x20000000 +#define KADM5_CONFIG_IPROP_RESYNC_TIMEOUT 0x40000000 +#define KADM5_CONFIG_IPROP_LISTEN 0x80000000 +/* + * permission bits + */ +#define KADM5_PRIV_GET 0x01 +#define KADM5_PRIV_ADD 0x02 +#define KADM5_PRIV_MODIFY 0x04 +#define KADM5_PRIV_DELETE 0x08 + +/* + * API versioning constants + */ +#define KADM5_MASK_BITS 0xffffff00 + +#define KADM5_STRUCT_VERSION_MASK 0x12345600 +#define KADM5_STRUCT_VERSION_1 (KADM5_STRUCT_VERSION_MASK|0x01) +#define KADM5_STRUCT_VERSION KADM5_STRUCT_VERSION_1 + +#define KADM5_API_VERSION_MASK 0x12345700 +#define KADM5_API_VERSION_2 (KADM5_API_VERSION_MASK|0x02) +#define KADM5_API_VERSION_3 (KADM5_API_VERSION_MASK|0x03) +#define KADM5_API_VERSION_4 (KADM5_API_VERSION_MASK|0x04) + +typedef struct _kadm5_principal_ent_t { + krb5_principal principal; + krb5_timestamp princ_expire_time; + krb5_timestamp last_pwd_change; + krb5_timestamp pw_expiration; + krb5_deltat max_life; + krb5_principal mod_name; + krb5_timestamp mod_date; + krb5_flags attributes; + krb5_kvno kvno; + krb5_kvno mkvno; + char *policy; + long aux_attributes; + + /* version 2 fields */ + krb5_deltat max_renewable_life; + krb5_timestamp last_success; + krb5_timestamp last_failed; + krb5_kvno fail_auth_count; + krb5_int16 n_key_data; + krb5_int16 n_tl_data; + krb5_tl_data *tl_data; + krb5_key_data *key_data; +} kadm5_principal_ent_rec, *kadm5_principal_ent_t; + +typedef struct _kadm5_policy_ent_t { + char *policy; + long pw_min_life; + long pw_max_life; + long pw_min_length; + long pw_min_classes; + long pw_history_num; + long policy_refcnt; /* no longer used */ + + /* version 3 fields */ + krb5_kvno pw_max_fail; + krb5_deltat pw_failcnt_interval; + krb5_deltat pw_lockout_duration; + + /* version 4 fields */ + krb5_flags attributes; + krb5_deltat max_life; + krb5_deltat max_renewable_life; + char *allowed_keysalts; + krb5_int16 n_tl_data; + krb5_tl_data *tl_data; +} kadm5_policy_ent_rec, *kadm5_policy_ent_t; + +/* + * Data structure returned by kadm5_get_config_params() + */ +typedef struct _kadm5_config_params { + long mask; + char * realm; + int kadmind_port; + int kpasswd_port; + + char * admin_server; +#ifdef notyet /* Novell */ /* ABI change? */ + char * kpasswd_server; +#endif + + /* Deprecated except for db2 backwards compatibility. Don't add + new uses except as fallbacks for parameters that should be + specified in the database module section of the config + file. */ + char * dbname; + + char * acl_file; + char * dict_file; + + int mkey_from_kbd; + char * stash_file; + char * mkey_name; + krb5_enctype enctype; + krb5_deltat max_life; + krb5_deltat max_rlife; + krb5_timestamp expiration; + krb5_flags flags; + krb5_key_salt_tuple *keysalts; + krb5_int32 num_keysalts; + krb5_kvno kvno; + bool_t iprop_enabled; + uint32_t iprop_ulogsize; + krb5_deltat iprop_poll_time; + char * iprop_logfile; +/* char * iprop_server;*/ + int iprop_port; + int iprop_resync_timeout; + char * kadmind_listen; + char * kpasswd_listen; + char * iprop_listen; +} kadm5_config_params; + +typedef struct _kadm5_key_data { + krb5_kvno kvno; + krb5_keyblock key; + krb5_keysalt salt; +} kadm5_key_data; + +/* + * functions + */ + +/* The use_kdc_config parameter is no longer used, as configuration is + * retrieved from the context profile. */ +krb5_error_code kadm5_get_config_params(krb5_context context, + int use_kdc_config, + kadm5_config_params *params_in, + kadm5_config_params *params_out); + +krb5_error_code kadm5_free_config_params(krb5_context context, + kadm5_config_params *params); + +krb5_error_code kadm5_get_admin_service_name(krb5_context, char *, + char *, size_t); + +/* + * For all initialization functions, the caller must first initialize + * a context with kadm5_init_krb5_context which will survive as long + * as the resulting handle. The caller should free the context with + * krb5_free_context. + */ + +kadm5_ret_t kadm5_init(krb5_context context, char *client_name, + char *pass, char *service_name, + kadm5_config_params *params, + krb5_ui_4 struct_version, + krb5_ui_4 api_version, + char **db_args, + void **server_handle); +kadm5_ret_t kadm5_init_anonymous(krb5_context context, char *client_name, + char *service_name, + kadm5_config_params *params, + krb5_ui_4 struct_version, + krb5_ui_4 api_version, + char **db_args, + void **server_handle); +kadm5_ret_t kadm5_init_with_password(krb5_context context, + char *client_name, + char *pass, + char *service_name, + kadm5_config_params *params, + krb5_ui_4 struct_version, + krb5_ui_4 api_version, + char **db_args, + void **server_handle); +kadm5_ret_t kadm5_init_with_skey(krb5_context context, + char *client_name, + char *keytab, + char *service_name, + kadm5_config_params *params, + krb5_ui_4 struct_version, + krb5_ui_4 api_version, + char **db_args, + void **server_handle); +kadm5_ret_t kadm5_init_with_creds(krb5_context context, + char *client_name, + krb5_ccache cc, + char *service_name, + kadm5_config_params *params, + krb5_ui_4 struct_version, + krb5_ui_4 api_version, + char **db_args, + void **server_handle); +kadm5_ret_t kadm5_lock(void *server_handle); +kadm5_ret_t kadm5_unlock(void *server_handle); +kadm5_ret_t kadm5_flush(void *server_handle); +kadm5_ret_t kadm5_destroy(void *server_handle); +kadm5_ret_t kadm5_create_principal(void *server_handle, + kadm5_principal_ent_t ent, + long mask, char *pass); +kadm5_ret_t kadm5_create_principal_3(void *server_handle, + kadm5_principal_ent_t ent, + long mask, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + char *pass); +kadm5_ret_t kadm5_delete_principal(void *server_handle, + krb5_principal principal); +kadm5_ret_t kadm5_modify_principal(void *server_handle, + kadm5_principal_ent_t ent, + long mask); +kadm5_ret_t kadm5_rename_principal(void *server_handle, + krb5_principal,krb5_principal); +kadm5_ret_t kadm5_get_principal(void *server_handle, + krb5_principal principal, + kadm5_principal_ent_t ent, + long mask); +kadm5_ret_t kadm5_chpass_principal(void *server_handle, + krb5_principal principal, + char *pass); +kadm5_ret_t kadm5_chpass_principal_3(void *server_handle, + krb5_principal principal, + unsigned int keepold, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + char *pass); +kadm5_ret_t kadm5_randkey_principal(void *server_handle, + krb5_principal principal, + krb5_keyblock **keyblocks, + int *n_keys); +kadm5_ret_t kadm5_randkey_principal_3(void *server_handle, + krb5_principal principal, + unsigned int keepold, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + krb5_keyblock **keyblocks, + int *n_keys); + +kadm5_ret_t kadm5_setkey_principal(void *server_handle, + krb5_principal principal, + krb5_keyblock *keyblocks, + int n_keys); + +kadm5_ret_t kadm5_setkey_principal_3(void *server_handle, + krb5_principal principal, + unsigned int keepold, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + krb5_keyblock *keyblocks, + int n_keys); + +kadm5_ret_t kadm5_setkey_principal_4(void *server_handle, + krb5_principal principal, + unsigned int keepold, + kadm5_key_data *key_data, + int n_key_data); + +kadm5_ret_t kadm5_decrypt_key(void *server_handle, + kadm5_principal_ent_t entry, krb5_int32 + ktype, krb5_int32 stype, krb5_int32 + kvno, krb5_keyblock *keyblock, + krb5_keysalt *keysalt, int *kvnop); + +kadm5_ret_t kadm5_create_policy(void *server_handle, + kadm5_policy_ent_t ent, + long mask); +kadm5_ret_t kadm5_delete_policy(void *server_handle, + kadm5_policy_t policy); +kadm5_ret_t kadm5_modify_policy(void *server_handle, + kadm5_policy_ent_t ent, + long mask); +kadm5_ret_t kadm5_get_policy(void *server_handle, + kadm5_policy_t policy, + kadm5_policy_ent_t ent); +kadm5_ret_t kadm5_get_privs(void *server_handle, + long *privs); + +kadm5_ret_t kadm5_chpass_principal_util(void *server_handle, + krb5_principal princ, + char *new_pw, + char **ret_pw, + char *msg_ret, + unsigned int msg_len); + +kadm5_ret_t kadm5_free_principal_ent(void *server_handle, + kadm5_principal_ent_t + ent); +kadm5_ret_t kadm5_free_policy_ent(void *server_handle, + kadm5_policy_ent_t ent); + +kadm5_ret_t kadm5_get_principals(void *server_handle, + char *exp, char ***princs, + int *count); + +kadm5_ret_t kadm5_get_policies(void *server_handle, + char *exp, char ***pols, + int *count); + +kadm5_ret_t kadm5_free_key_data(void *server_handle, + krb5_int16 *n_key_data, + krb5_key_data *key_data); + +kadm5_ret_t kadm5_free_name_list(void *server_handle, char **names, + int count); + +krb5_error_code kadm5_init_krb5_context (krb5_context *); + +krb5_error_code kadm5_init_iprop(void *server_handle, char **db_args); + +kadm5_ret_t kadm5_get_principal_keys(void *server_handle, + krb5_principal principal, + krb5_kvno kvno, + kadm5_key_data **key_data, + int *n_key_data); + +kadm5_ret_t kadm5_purgekeys(void *server_handle, + krb5_principal principal, + int keepkvno); + +kadm5_ret_t kadm5_get_strings(void *server_handle, + krb5_principal principal, + krb5_string_attr **strings_out, + int *count_out); + +kadm5_ret_t kadm5_set_string(void *server_handle, + krb5_principal principal, + const char *key, + const char *value); + +kadm5_ret_t kadm5_free_strings(void *server_handle, + krb5_string_attr *strings, + int count); + +kadm5_ret_t kadm5_free_kadm5_key_data(krb5_context context, int n_key_data, + kadm5_key_data *key_data); + +kadm5_ret_t kadm5_create_alias(void *server_handle, krb5_principal alias, + krb5_principal target); + +KADM5INT_END_DECLS + +#endif /* __KADM5_ADMIN_H__ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/chpass_util_strings.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/chpass_util_strings.h new file mode 100644 index 0000000000000000000000000000000000000000..231a3b67491dd412225214b4a2d744f632f47afc --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/chpass_util_strings.h @@ -0,0 +1,38 @@ +/* + * et-h-chpass_util_strings.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define CHPASS_UTIL_GET_POLICY_INFO (-1492553984L) +#define CHPASS_UTIL_GET_PRINC_INFO (-1492553983L) +#define CHPASS_UTIL_NEW_PASSWORD_MISMATCH (-1492553982L) +#define CHPASS_UTIL_NEW_PASSWORD_PROMPT (-1492553981L) +#define CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT (-1492553980L) +#define CHPASS_UTIL_NO_PASSWORD_READ (-1492553979L) +#define CHPASS_UTIL_NO_POLICY_YET_Q_ERROR (-1492553978L) +#define CHPASS_UTIL_PASSWORD_CHANGED (-1492553977L) +#define CHPASS_UTIL_PASSWORD_IN_DICTIONARY (-1492553976L) +#define CHPASS_UTIL_PASSWORD_NOT_CHANGED (-1492553975L) +#define CHPASS_UTIL_PASSWORD_TOO_SHORT (-1492553974L) +#define CHPASS_UTIL_TOO_FEW_CLASSES (-1492553973L) +#define CHPASS_UTIL_PASSWORD_TOO_SOON (-1492553972L) +#define CHPASS_UTIL_PASSWORD_REUSE (-1492553971L) +#define CHPASS_UTIL_WHILE_TRYING_TO_CHANGE (-1492553970L) +#define CHPASS_UTIL_WHILE_READING_PASSWORD (-1492553969L) +#define ERROR_TABLE_BASE_ovku (-1492553984L) + +extern const struct error_table et_ovku_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_ovku_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_ovku_error_table() +#endif + +#if !defined(_WIN32) +#define init_ovku_err_tbl initialize_ovku_error_table +#define ovku_err_base ERROR_TABLE_BASE_ovku +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/kadm_err.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/kadm_err.h new file mode 100644 index 0000000000000000000000000000000000000000..4ae60c79f15ac19e0496a1e891ad27c4d5130b1a --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kadm5/kadm_err.h @@ -0,0 +1,86 @@ +/* + * et-h-kadm_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KADM5_FAILURE (43787520L) +#define KADM5_AUTH_GET (43787521L) +#define KADM5_AUTH_ADD (43787522L) +#define KADM5_AUTH_MODIFY (43787523L) +#define KADM5_AUTH_DELETE (43787524L) +#define KADM5_AUTH_INSUFFICIENT (43787525L) +#define KADM5_BAD_DB (43787526L) +#define KADM5_DUP (43787527L) +#define KADM5_RPC_ERROR (43787528L) +#define KADM5_NO_SRV (43787529L) +#define KADM5_BAD_HIST_KEY (43787530L) +#define KADM5_NOT_INIT (43787531L) +#define KADM5_UNK_PRINC (43787532L) +#define KADM5_UNK_POLICY (43787533L) +#define KADM5_BAD_MASK (43787534L) +#define KADM5_BAD_CLASS (43787535L) +#define KADM5_BAD_LENGTH (43787536L) +#define KADM5_BAD_POLICY (43787537L) +#define KADM5_BAD_PRINCIPAL (43787538L) +#define KADM5_BAD_AUX_ATTR (43787539L) +#define KADM5_BAD_HISTORY (43787540L) +#define KADM5_BAD_MIN_PASS_LIFE (43787541L) +#define KADM5_PASS_Q_TOOSHORT (43787542L) +#define KADM5_PASS_Q_CLASS (43787543L) +#define KADM5_PASS_Q_DICT (43787544L) +#define KADM5_PASS_REUSE (43787545L) +#define KADM5_PASS_TOOSOON (43787546L) +#define KADM5_POLICY_REF (43787547L) +#define KADM5_INIT (43787548L) +#define KADM5_BAD_PASSWORD (43787549L) +#define KADM5_PROTECT_PRINCIPAL (43787550L) +#define KADM5_BAD_SERVER_HANDLE (43787551L) +#define KADM5_BAD_STRUCT_VERSION (43787552L) +#define KADM5_OLD_STRUCT_VERSION (43787553L) +#define KADM5_NEW_STRUCT_VERSION (43787554L) +#define KADM5_BAD_API_VERSION (43787555L) +#define KADM5_OLD_LIB_API_VERSION (43787556L) +#define KADM5_OLD_SERVER_API_VERSION (43787557L) +#define KADM5_NEW_LIB_API_VERSION (43787558L) +#define KADM5_NEW_SERVER_API_VERSION (43787559L) +#define KADM5_SECURE_PRINC_MISSING (43787560L) +#define KADM5_NO_RENAME_SALT (43787561L) +#define KADM5_BAD_CLIENT_PARAMS (43787562L) +#define KADM5_BAD_SERVER_PARAMS (43787563L) +#define KADM5_AUTH_LIST (43787564L) +#define KADM5_AUTH_CHANGEPW (43787565L) +#define KADM5_GSS_ERROR (43787566L) +#define KADM5_BAD_TL_TYPE (43787567L) +#define KADM5_MISSING_CONF_PARAMS (43787568L) +#define KADM5_BAD_SERVER_NAME (43787569L) +#define KADM5_AUTH_SETKEY (43787570L) +#define KADM5_SETKEY_DUP_ENCTYPES (43787571L) +#define KADM5_SETV4KEY_INVAL_ENCTYPE (43787572L) +#define KADM5_SETKEY3_ETYPE_MISMATCH (43787573L) +#define KADM5_MISSING_KRB5_CONF_PARAMS (43787574L) +#define KADM5_XDR_FAILURE (43787575L) +#define KADM5_CANT_RESOLVE (43787576L) +#define KADM5_PASS_Q_GENERIC (43787577L) +#define KADM5_BAD_KEYSALTS (43787578L) +#define KADM5_SETKEY_BAD_KVNO (43787579L) +#define KADM5_AUTH_EXTRACT (43787580L) +#define KADM5_PROTECT_KEYS (43787581L) +#define KADM5_AUTH_INITIAL (43787582L) +#define KADM5_ALIAS_REALM (43787583L) +#define ERROR_TABLE_BASE_ovk (43787520L) + +extern const struct error_table et_ovk_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_ovk_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_ovk_error_table() +#endif + +#if !defined(_WIN32) +#define init_ovk_err_tbl initialize_ovk_error_table +#define ovk_err_base ERROR_TABLE_BASE_ovk +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kdb.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kdb.h new file mode 100644 index 0000000000000000000000000000000000000000..17a3456822d0cd389045dec1c708f17c9c2130ef --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/kdb.h @@ -0,0 +1,1489 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright 1990, 1991, 2016 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* KDC Database interface definitions */ + +/* This API is not considered as stable as the main krb5 API. + * + * - We may make arbitrary incompatible changes between feature + * releases (e.g. from 1.7 to 1.8). + * - We will make some effort to avoid making incompatible changes for + * bugfix releases, but will make them if necessary. + */ + +#ifndef KRB5_KDB5__ +#define KRB5_KDB5__ + +#include +#include + +/* This version will be incremented when incompatible changes are made to the + * KDB API, and will be kept in sync with the libkdb major version. */ +#define KRB5_KDB_API_VERSION 10 + +/* Salt types */ +#define KRB5_KDB_SALTTYPE_NORMAL 0 +/* #define KRB5_KDB_SALTTYPE_V4 1 */ +#define KRB5_KDB_SALTTYPE_NOREALM 2 +#define KRB5_KDB_SALTTYPE_ONLYREALM 3 +#define KRB5_KDB_SALTTYPE_SPECIAL 4 +/* #define KRB5_KDB_SALTTYPE_AFS3 5 */ +#define KRB5_KDB_SALTTYPE_CERTHASH 6 + +/* Attributes */ +#define KRB5_KDB_DISALLOW_POSTDATED 0x00000001 +#define KRB5_KDB_DISALLOW_FORWARDABLE 0x00000002 +#define KRB5_KDB_DISALLOW_TGT_BASED 0x00000004 +#define KRB5_KDB_DISALLOW_RENEWABLE 0x00000008 +#define KRB5_KDB_DISALLOW_PROXIABLE 0x00000010 +#define KRB5_KDB_DISALLOW_DUP_SKEY 0x00000020 +#define KRB5_KDB_DISALLOW_ALL_TIX 0x00000040 +#define KRB5_KDB_REQUIRES_PRE_AUTH 0x00000080 +#define KRB5_KDB_REQUIRES_HW_AUTH 0x00000100 +#define KRB5_KDB_REQUIRES_PWCHANGE 0x00000200 +#define KRB5_KDB_DISALLOW_SVR 0x00001000 +#define KRB5_KDB_PWCHANGE_SERVICE 0x00002000 +#define KRB5_KDB_SUPPORT_DESMD5 0x00004000 +#define KRB5_KDB_NEW_PRINC 0x00008000 +#define KRB5_KDB_OK_AS_DELEGATE 0x00100000 +#define KRB5_KDB_OK_TO_AUTH_AS_DELEGATE 0x00200000 /* S4U2Self OK */ +#define KRB5_KDB_NO_AUTH_DATA_REQUIRED 0x00400000 +#define KRB5_KDB_LOCKDOWN_KEYS 0x00800000 + +/* Creation flags */ +#define KRB5_KDB_CREATE_BTREE 0x00000001 +#define KRB5_KDB_CREATE_HASH 0x00000002 + +/* Entry get flags */ +/* Okay to generate a referral on lookup */ +#define KRB5_KDB_FLAG_REFERRAL_OK 0x00000010 +/* Client principal lookup (client referrals only) */ +#define KRB5_KDB_FLAG_CLIENT 0x00000040 +/* Map cross-realm principals */ +#define KRB5_KDB_FLAG_MAP_PRINCIPALS 0x00000080 +/* Protocol transition */ +#define KRB5_KDB_FLAG_PROTOCOL_TRANSITION 0x00000100 +/* Constrained delegation */ +#define KRB5_KDB_FLAG_CONSTRAINED_DELEGATION 0x00000200 +/* User-to-user */ +#define KRB5_KDB_FLAG_USER_TO_USER 0x00000800 +/* Cross-realm */ +#define KRB5_KDB_FLAG_CROSS_REALM 0x00001000 +/* Issuing referral */ +#define KRB5_KDB_FLAG_ISSUING_REFERRAL 0x00004000 + + +#define KRB5_KDB_FLAGS_S4U ( KRB5_KDB_FLAG_PROTOCOL_TRANSITION | \ + KRB5_KDB_FLAG_CONSTRAINED_DELEGATION ) + +/* KDB iteration flags */ +#define KRB5_DB_ITER_WRITE 0x00000001 +#define KRB5_DB_ITER_REV 0x00000002 +#define KRB5_DB_ITER_RECURSE 0x00000004 + +/* String attribute names recognized by krb5 */ +#define KRB5_KDB_SK_PAC_PRIVSVR_ENCTYPE "pac_privsvr_enctype" +#define KRB5_KDB_SK_SESSION_ENCTYPES "session_enctypes" +#define KRB5_KDB_SK_REQUIRE_AUTH "require_auth" + +#if !defined(_WIN32) + +/* + * Note --- these structures cannot be modified without changing the + * database version number in libkdb.a, but should be expandable by + * adding new tl_data types. + */ +typedef struct _krb5_tl_data { + struct _krb5_tl_data* tl_data_next; /* NOT saved */ + krb5_int16 tl_data_type; + krb5_ui_2 tl_data_length; + krb5_octet * tl_data_contents; +} krb5_tl_data; + +/* String attributes (currently stored inside tl-data) map C string keys to + * values. They can be set via kadmin and consumed by KDC plugins. */ +typedef struct krb5_string_attr_st { + char *key; + char *value; +} krb5_string_attr; + +/* + * If this ever changes up the version number and make the arrays be as + * big as necessary. + * + * Currently the first type is the enctype and the second is the salt type. + */ +typedef struct _krb5_key_data { + krb5_int16 key_data_ver; /* Version */ + krb5_ui_2 key_data_kvno; /* Key Version */ + krb5_int16 key_data_type[2]; /* Array of types */ + krb5_ui_2 key_data_length[2]; /* Array of lengths */ + krb5_octet * key_data_contents[2]; /* Array of pointers */ +} krb5_key_data; + +#define KRB5_KDB_V1_KEY_DATA_ARRAY 2 /* # of array elements */ + +typedef struct _krb5_keysalt { + krb5_int16 type; + krb5_data data; /* Length, data */ +} krb5_keysalt; + +/* + * A principal database entry. Extensions to this structure currently use the + * tl_data list. The e_data and e_length fields are not used by any calling + * code except kdb5_util dump and load, which marshal and unmarshal the array + * in the dump record. KDB modules may use these fields internally as long as + * they set e_length appropriately (non-zero if the data should be marshalled + * across dump and load, zero if not) and handle null e_data values in + * caller-constructed principal entries. + */ +typedef struct _krb5_db_entry_new { + krb5_magic magic; /* NOT saved */ + krb5_ui_2 len; + krb5_ui_4 mask; /* members currently changed/set */ + krb5_flags attributes; + krb5_deltat max_life; + krb5_deltat max_renewable_life; + krb5_timestamp expiration; /* When the client expires */ + krb5_timestamp pw_expiration; /* When its passwd expires */ + krb5_timestamp last_success; /* Last successful passwd */ + krb5_timestamp last_failed; /* Last failed passwd attempt */ + krb5_kvno fail_auth_count; /* # of failed passwd attempt */ + krb5_int16 n_tl_data; + krb5_int16 n_key_data; + krb5_ui_2 e_length; /* Length of extra data */ + krb5_octet * e_data; /* Extra data to be saved */ + + krb5_principal princ; /* Length, data */ + krb5_tl_data * tl_data; /* Linked list */ + + /* key_data must be sorted by kvno in descending order. */ + krb5_key_data * key_data; /* Array */ +} krb5_db_entry; + +typedef struct _osa_policy_ent_t { + int version; + char *name; + krb5_ui_4 pw_min_life; + krb5_ui_4 pw_max_life; + krb5_ui_4 pw_min_length; + krb5_ui_4 pw_min_classes; + krb5_ui_4 pw_history_num; + krb5_ui_4 policy_refcnt; /* no longer used */ + /* Only valid if version > 1 */ + krb5_ui_4 pw_max_fail; /* pwdMaxFailure */ + krb5_ui_4 pw_failcnt_interval; /* pwdFailureCountInterval */ + krb5_ui_4 pw_lockout_duration; /* pwdLockoutDuration */ + /* Only valid if version > 2 */ + krb5_ui_4 attributes; + krb5_ui_4 max_life; + krb5_ui_4 max_renewable_life; + char * allowed_keysalts; + krb5_int16 n_tl_data; + krb5_tl_data * tl_data; +} osa_policy_ent_rec, *osa_policy_ent_t; + +typedef void (*osa_adb_iter_policy_func) (void *, osa_policy_ent_t); + +typedef struct __krb5_key_salt_tuple { + krb5_enctype ks_enctype; + krb5_int32 ks_salttype; +} krb5_key_salt_tuple; + +#define KRB5_KDB_MAGIC_NUMBER 0xdbdbdbdb +#define KRB5_KDB_V1_BASE_LENGTH 38 + +#define KRB5_KDB_MAX_ALLOWED_KS_LEN 512 + +#define KRB5_TL_LAST_PWD_CHANGE 0x0001 +#define KRB5_TL_MOD_PRINC 0x0002 +#define KRB5_TL_KADM_DATA 0x0003 +#define KRB5_TL_KADM5_E_DATA 0x0004 +#define KRB5_TL_RB1_CHALLENGE 0x0005 +#ifdef SECURID +#define KRB5_TL_SECURID_STATE 0x0006 +#endif /* SECURID */ +#define KRB5_TL_USER_CERTIFICATE 0x0007 +#define KRB5_TL_MKVNO 0x0008 +#define KRB5_TL_ACTKVNO 0x0009 +#define KRB5_TL_MKEY_AUX 0x000a + +/* String attributes may not always be represented in tl-data. kadmin clients + * must use the get_strings and set_string RPCs. */ +#define KRB5_TL_STRING_ATTRS 0x000b + +#define KRB5_TL_ALIAS_TARGET 0x000c + +#define KRB5_TL_PAC_LOGON_INFO 0x0100 /* NDR encoded validation info */ +#define KRB5_TL_SERVER_REFERRAL 0x0200 /* ASN.1 encoded ServerReferralInfo */ +#define KRB5_TL_SVR_REFERRAL_DATA 0x0300 /* ASN.1 encoded PA-SVR-REFERRAL-DATA */ +#define KRB5_TL_CONSTRAINED_DELEGATION_ACL 0x0400 /* Each entry is a permitted SPN */ +#define KRB5_TL_LM_KEY 0x0500 /* LM OWF */ +#define KRB5_TL_X509_SUBJECT_ISSUER_NAME 0x0600 /* IssuerDNSubjectDN */ +#define KRB5_TL_LAST_ADMIN_UNLOCK 0x0700 /* Timestamp of admin unlock */ + +#define KRB5_TL_DB_ARGS 0x7fff + +/* version number for KRB5_TL_ACTKVNO data */ +#define KRB5_TL_ACTKVNO_VER 1 + +/* version number for KRB5_TL_MKEY_AUX data */ +#define KRB5_TL_MKEY_AUX_VER 1 + +typedef struct _krb5_actkvno_node { + struct _krb5_actkvno_node *next; + krb5_kvno act_kvno; + krb5_timestamp act_time; +} krb5_actkvno_node; + +typedef struct _krb5_mkey_aux_node { + struct _krb5_mkey_aux_node *next; + krb5_kvno mkey_kvno; /* kvno of mkey protecting the latest_mkey */ + krb5_key_data latest_mkey; /* most recent mkey */ +} krb5_mkey_aux_node; + +typedef struct _krb5_keylist_node { + krb5_keyblock keyblock; + krb5_kvno kvno; + struct _krb5_keylist_node *next; +} krb5_keylist_node; + +/* + * Determines the number of failed KDC requests before DISALLOW_ALL_TIX is set + * on the principal. + */ +#define KRB5_MAX_FAIL_COUNT 5 + +/* XXX depends on knowledge of krb5_parse_name() formats */ +#define KRB5_KDB_M_NAME "K/M" /* Kerberos/Master */ + +/* prompts used by default when reading the KDC password from the keyboard. */ +#define KRB5_KDC_MKEY_1 "Enter KDC database master key" +#define KRB5_KDC_MKEY_2 "Re-enter KDC database master key to verify" + + +extern char *krb5_mkey_pwd_prompt1; +extern char *krb5_mkey_pwd_prompt2; + +/* + * These macros specify the encoding of data within the database. + * + * Data encoding is little-endian. + */ +#ifdef _KRB5_INT_H +#include "k5-platform.h" +#define krb5_kdb_decode_int16(cp, i16) \ + *((krb5_int16 *) &(i16)) = load_16_le(cp) +#define krb5_kdb_decode_int32(cp, i32) \ + *((krb5_int32 *) &(i32)) = load_32_le(cp) +#define krb5_kdb_encode_int16(i16, cp) store_16_le(i16, cp) +#define krb5_kdb_encode_int32(i32, cp) store_32_le(i32, cp) +#endif /* _KRB5_INT_H */ + +#define KRB5_KDB_OPEN_RW 0 +#define KRB5_KDB_OPEN_RO 1 + +#ifndef KRB5_KDB_SRV_TYPE_KDC +#define KRB5_KDB_SRV_TYPE_KDC 0x0100 +#endif + +#ifndef KRB5_KDB_SRV_TYPE_ADMIN +#define KRB5_KDB_SRV_TYPE_ADMIN 0x0200 +#endif + +/* 0x0300 was KRB5_KDB_SRV_TYPE_PASSWD but it is no longer used. */ + +#ifndef KRB5_KDB_SRV_TYPE_OTHER +#define KRB5_KDB_SRV_TYPE_OTHER 0x0400 +#endif + +#define KRB5_KDB_OPT_SET_DB_NAME 0 +#define KRB5_KDB_OPT_SET_LOCK_MODE 1 + +#define KRB5_DB_LOCKMODE_SHARED 0x0001 +#define KRB5_DB_LOCKMODE_EXCLUSIVE 0x0002 +#define KRB5_DB_LOCKMODE_PERMANENT 0x0008 + +/* + * Load the specified KDB module, to be used for KDB operations with kcontext. + * This function must be called prior to any KDB operations with kcontext. + * name will be looked up relative to the configured database directories, with + * platform-specific suffixes suitable for shared objects. This function can + * be used to implement one KDB module in terms of another, but the outer + * module must supply a separate krb5_context from the one passed to its + * methods. + */ +krb5_error_code krb5_db_load_module(krb5_context kcontext, const char *name); + +krb5_error_code krb5_db_setup_lib_handle(krb5_context kcontext); +krb5_error_code krb5_db_open( krb5_context kcontext, char **db_args, int mode ); +krb5_error_code krb5_db_init ( krb5_context kcontext ); +krb5_error_code krb5_db_create ( krb5_context kcontext, char **db_args ); +krb5_error_code krb5_db_inited ( krb5_context kcontext ); +krb5_error_code kdb5_db_create ( krb5_context kcontext, char **db_args ); +krb5_error_code krb5_db_fini ( krb5_context kcontext ); +const char * krb5_db_errcode2string ( krb5_context kcontext, long err_code ); +krb5_error_code krb5_db_destroy ( krb5_context kcontext, char **db_args ); +krb5_error_code krb5_db_promote ( krb5_context kcontext, char **db_args ); +krb5_error_code krb5_db_get_age ( krb5_context kcontext, char *db_name, time_t *t ); +krb5_error_code krb5_db_lock ( krb5_context kcontext, int lock_mode ); +krb5_error_code krb5_db_unlock ( krb5_context kcontext ); +krb5_error_code krb5_db_get_principal ( krb5_context kcontext, + krb5_const_principal search_for, + unsigned int flags, + krb5_db_entry **entry ); +void krb5_db_free_principal ( krb5_context kcontext, krb5_db_entry *entry ); +krb5_error_code krb5_db_put_principal ( krb5_context kcontext, + krb5_db_entry *entry ); +krb5_error_code krb5_db_delete_principal ( krb5_context kcontext, + krb5_principal search_for ); +krb5_error_code krb5_db_rename_principal ( krb5_context kcontext, + krb5_principal source, + krb5_principal target ); + +/* + * Iterate over principals in the KDB. If the callback may write to the DB, + * the caller must get an exclusive lock with krb5_db_lock before iterating, + * and release it with krb5_db_unlock after iterating. + */ +krb5_error_code krb5_db_iterate ( krb5_context kcontext, + char *match_entry, + int (*func) (krb5_pointer, krb5_db_entry *), + krb5_pointer func_arg, krb5_flags iterflags ); + + +krb5_error_code krb5_db_store_master_key ( krb5_context kcontext, + char *keyfile, + krb5_principal mname, + krb5_kvno kvno, + krb5_keyblock *key, + char *master_pwd); +krb5_error_code krb5_db_store_master_key_list ( krb5_context kcontext, + char *keyfile, + krb5_principal mname, + char *master_pwd); +krb5_error_code krb5_db_fetch_mkey ( krb5_context context, + krb5_principal mname, + krb5_enctype etype, + krb5_boolean fromkeyboard, + krb5_boolean twice, + char *db_args, + krb5_kvno *kvno, + krb5_data *salt, + krb5_keyblock *key); +krb5_error_code +krb5_db_fetch_mkey_list( krb5_context context, + krb5_principal mname, + const krb5_keyblock * mkey ); + +krb5_error_code +krb5_dbe_find_enctype( krb5_context kcontext, + krb5_db_entry *dbentp, + krb5_int32 ktype, + krb5_int32 stype, + krb5_int32 kvno, + krb5_key_data **kdatap); + + +krb5_error_code krb5_dbe_search_enctype ( krb5_context kcontext, + krb5_db_entry *dbentp, + krb5_int32 *start, + krb5_int32 ktype, + krb5_int32 stype, + krb5_int32 kvno, + krb5_key_data **kdatap); + +krb5_error_code +krb5_db_setup_mkey_name ( krb5_context context, + const char *keyname, + const char *realm, + char **fullname, + krb5_principal *principal); + +/** + * Decrypts the key given in @@a key_data. If @a mkey is specified, that + * master key is used. If @a mkey is NULL, then all master keys are tried. + */ +krb5_error_code +krb5_dbe_decrypt_key_data( krb5_context context, + const krb5_keyblock * mkey, + const krb5_key_data * key_data, + krb5_keyblock * dbkey, + krb5_keysalt * keysalt); + +krb5_error_code +krb5_dbe_encrypt_key_data( krb5_context context, + const krb5_keyblock * mkey, + const krb5_keyblock * dbkey, + const krb5_keysalt * keysalt, + int keyver, + krb5_key_data * key_data); + +krb5_error_code +krb5_dbe_fetch_act_key_list(krb5_context context, + krb5_principal princ, + krb5_actkvno_node **act_key_list); + +krb5_error_code +krb5_dbe_find_act_mkey( krb5_context context, + krb5_actkvno_node * act_mkey_list, + krb5_kvno * act_kvno, + krb5_keyblock ** act_mkey); + +krb5_error_code +krb5_dbe_find_mkey( krb5_context context, + krb5_db_entry * entry, + krb5_keyblock ** mkey); + +/* Set *mkvno to mkvno in entry tl_data, or 0 if not present. */ +krb5_error_code +krb5_dbe_lookup_mkvno( krb5_context context, + krb5_db_entry * entry, + krb5_kvno * mkvno); + +krb5_keylist_node * +krb5_db_mkey_list_alias( krb5_context kcontext ); + +/* Set *mkvno to mkvno in entry tl_data, or minimum value from mkey_list. */ +krb5_error_code +krb5_dbe_get_mkvno( krb5_context context, + krb5_db_entry * entry, + krb5_kvno * mkvno); + +krb5_error_code +krb5_dbe_lookup_mod_princ_data( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp * mod_time, + krb5_principal * mod_princ); + +krb5_error_code +krb5_dbe_lookup_mkey_aux( krb5_context context, + krb5_db_entry * entry, + krb5_mkey_aux_node ** mkey_aux_data_list); +krb5_error_code +krb5_dbe_update_mkvno( krb5_context context, + krb5_db_entry * entry, + krb5_kvno mkvno); + +krb5_error_code +krb5_dbe_lookup_actkvno( krb5_context context, + krb5_db_entry * entry, + krb5_actkvno_node ** actkvno_list); + +krb5_error_code +krb5_dbe_update_mkey_aux( krb5_context context, + krb5_db_entry * entry, + krb5_mkey_aux_node * mkey_aux_data_list); + +krb5_error_code +krb5_dbe_update_actkvno(krb5_context context, + krb5_db_entry * entry, + const krb5_actkvno_node *actkvno_list); + +krb5_error_code +krb5_dbe_update_last_pwd_change( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp stamp); + +krb5_error_code +krb5_dbe_update_last_admin_unlock( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp stamp); + +krb5_error_code +krb5_dbe_lookup_tl_data( krb5_context context, + krb5_db_entry * entry, + krb5_tl_data * ret_tl_data); + +krb5_error_code +krb5_dbe_create_key_data( krb5_context context, + krb5_db_entry * entry); + + +krb5_error_code +krb5_dbe_update_mod_princ_data( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp mod_date, + krb5_const_principal mod_princ); + +/* + * These are wrappers around realloc() and free(). Applications and KDB + * modules can use them when manipulating principal and policy entries to + * ensure that they allocate and free memory in a manner compatible with the + * library. Using libkrb5 or libkbd5 functions to construct values (such as + * krb5_copy_principal() to construct the princ field of a krb5_db_entry) is + * also safe. On Unix platforms, just using malloc() and free() is safe as + * long as the application or module does not use a malloc replacement. + */ +void *krb5_db_alloc( krb5_context kcontext, + void *ptr, + size_t size ); +void krb5_db_free( krb5_context kcontext, + void *ptr); + + +krb5_error_code +krb5_dbe_lookup_last_pwd_change( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp * stamp); + +krb5_error_code +krb5_dbe_lookup_last_admin_unlock( krb5_context context, + krb5_db_entry * entry, + krb5_timestamp * stamp); + +/* Retrieve the set of string attributes in entry, in no particular order. + * Free *strings_out with krb5_dbe_free_strings when done. */ +krb5_error_code +krb5_dbe_get_strings(krb5_context context, krb5_db_entry *entry, + krb5_string_attr **strings_out, int *count_out); + +/* Retrieve a single string attribute from entry, or NULL if there is no + * attribute for key. Free *value_out with krb5_dbe_free_string when done. */ +krb5_error_code +krb5_dbe_get_string(krb5_context context, krb5_db_entry *entry, + const char *key, char **value_out); + +/* Change or add a string attribute in entry, or delete it if value is NULL. */ +krb5_error_code +krb5_dbe_set_string(krb5_context context, krb5_db_entry *entry, + const char *key, const char *value); + +krb5_error_code +krb5_dbe_delete_tl_data( krb5_context context, + krb5_db_entry * entry, + krb5_int16 tl_data_type); + +krb5_error_code +krb5_db_update_tl_data(krb5_context context, + krb5_int16 * n_tl_datap, + krb5_tl_data **tl_datap, + krb5_tl_data * new_tl_data); + +krb5_error_code +krb5_dbe_update_tl_data( krb5_context context, + krb5_db_entry * entry, + krb5_tl_data * new_tl_data); + +/* Compute the salt for a key data entry given the corresponding principal. */ +krb5_error_code +krb5_dbe_compute_salt(krb5_context context, const krb5_key_data *key, + krb5_const_principal princ, krb5_int16 *salttype_out, + krb5_data **salt_out); + +/* + * Modify the key data of entry to explicitly store salt values using the + * KRB5_KDB_SALTTYPE_SPECIAL salt type. + */ +krb5_error_code +krb5_dbe_specialize_salt(krb5_context context, krb5_db_entry *entry); + +krb5_error_code +krb5_dbe_cpw( krb5_context kcontext, + krb5_keyblock * master_key, + krb5_key_salt_tuple * ks_tuple, + int ks_tuple_count, + char * passwd, + int new_kvno, + unsigned int keepold, + krb5_db_entry * db_entry); + + +krb5_error_code +krb5_dbe_ark( krb5_context context, + krb5_keyblock * master_key, + krb5_key_salt_tuple * ks_tuple, + int ks_tuple_count, + krb5_db_entry * db_entry); + +krb5_error_code +krb5_dbe_crk( krb5_context context, + krb5_keyblock * master_key, + krb5_key_salt_tuple * ks_tuple, + int ks_tuple_count, + unsigned int keepold, + krb5_db_entry * db_entry); + +krb5_error_code +krb5_dbe_apw( krb5_context context, + krb5_keyblock * master_key, + krb5_key_salt_tuple * ks_tuple, + int ks_tuple_count, + char * passwd, + krb5_db_entry * db_entry); + +int +krb5_db_get_key_data_kvno( krb5_context context, + int count, + krb5_key_data * data); + +krb5_error_code krb5_db_check_transited_realms(krb5_context kcontext, + const krb5_data *tr_contents, + const krb5_data *client_realm, + const krb5_data *server_realm); + +krb5_error_code krb5_db_check_policy_as(krb5_context kcontext, + krb5_kdc_req *request, + krb5_db_entry *client, + krb5_db_entry *server, + krb5_timestamp kdc_time, + const char **status, + krb5_pa_data ***e_data); + +krb5_error_code krb5_db_check_policy_tgs(krb5_context kcontext, + krb5_kdc_req *request, + krb5_db_entry *server, + krb5_ticket *ticket, + const char **status, + krb5_pa_data ***e_data); + +void krb5_db_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, + const krb5_address *local_addr, + const krb5_address *remote_addr, + krb5_db_entry *client, krb5_db_entry *server, + krb5_timestamp authtime, krb5_error_code error_code); + +void krb5_db_refresh_config(krb5_context kcontext); + +krb5_error_code krb5_db_check_allowed_to_delegate(krb5_context kcontext, + krb5_const_principal client, + const krb5_db_entry *server, + krb5_const_principal proxy); + +krb5_error_code krb5_db_get_s4u_x509_principal(krb5_context kcontext, + const krb5_data *client_cert, + krb5_const_principal in_princ, + unsigned int flags, + krb5_db_entry **entry); + +krb5_error_code krb5_db_allowed_to_delegate_from(krb5_context context, + krb5_const_principal client, + krb5_const_principal server, + krb5_pac server_pac, + const krb5_db_entry *proxy); + +/** + * Sort an array of @a krb5_key_data keys in descending order by their kvno. + * Key data order within a kvno is preserved. + * + * @param key_data + * The @a krb5_key_data array to sort. This is sorted in place so the + * array will be modified. + * @param key_data_length + * The length of @a key_data. + */ +void +krb5_dbe_sort_key_data(krb5_key_data *key_data, size_t key_data_length); + +krb5_error_code +krb5_db_issue_pac(krb5_context context, unsigned int flags, + krb5_db_entry *client, krb5_keyblock *replaced_reply_key, + krb5_db_entry *server, krb5_db_entry *krbtgt, + krb5_timestamp authtime, krb5_pac old_pac, krb5_pac new_pac, + krb5_data ***auth_indicators); + +/* default functions. Should not be directly called */ +/* + * Default functions prototype + */ + +krb5_error_code +krb5_dbe_def_search_enctype( krb5_context kcontext, + krb5_db_entry *dbentp, + krb5_int32 *start, + krb5_int32 ktype, + krb5_int32 stype, + krb5_int32 kvno, + krb5_key_data **kdatap); + +krb5_error_code +krb5_def_store_mkey_list( krb5_context context, + char *keyfile, + krb5_principal mname, + krb5_keylist_node *keylist, + char *master_pwd); + +krb5_error_code +krb5_db_def_fetch_mkey( krb5_context context, + krb5_principal mname, + krb5_keyblock *key, + krb5_kvno *kvno, + char *db_args); + +krb5_error_code +krb5_def_fetch_mkey_list( krb5_context context, + krb5_principal mprinc, + const krb5_keyblock *mkey, + krb5_keylist_node **mkeys_list); + +krb5_error_code +krb5_dbe_def_cpw( krb5_context context, + krb5_keyblock * master_key, + krb5_key_salt_tuple * ks_tuple, + int ks_tuple_count, + char * passwd, + int new_kvno, + unsigned int keepold, + krb5_db_entry * db_entry); + +krb5_error_code +krb5_dbe_def_decrypt_key_data( krb5_context context, + const krb5_keyblock * mkey, + const krb5_key_data * key_data, + krb5_keyblock * dbkey, + krb5_keysalt * keysalt); + +krb5_error_code +krb5_dbe_def_encrypt_key_data( krb5_context context, + const krb5_keyblock * mkey, + const krb5_keyblock * dbkey, + const krb5_keysalt * keysalt, + int keyver, + krb5_key_data * key_data); + +krb5_error_code +krb5_db_def_rename_principal( krb5_context kcontext, + krb5_const_principal source, + krb5_const_principal target); + +krb5_error_code +krb5_db_create_policy( krb5_context kcontext, + osa_policy_ent_t policy); + +krb5_error_code +krb5_db_get_policy ( krb5_context kcontext, + char *name, + osa_policy_ent_t *policy ); + +krb5_error_code +krb5_db_put_policy( krb5_context kcontext, + osa_policy_ent_t policy); + +krb5_error_code +krb5_db_iter_policy( krb5_context kcontext, + char *match_entry, + osa_adb_iter_policy_func func, + void *data); + +krb5_error_code +krb5_db_delete_policy( krb5_context kcontext, + char *policy); + +void +krb5_db_free_policy( krb5_context kcontext, + osa_policy_ent_t policy); + + +krb5_error_code +krb5_db_set_context(krb5_context, void *db_context); + +krb5_error_code +krb5_db_get_context(krb5_context, void **db_context); + +void +krb5_dbe_free_key_data_contents(krb5_context, krb5_key_data *); + +void +krb5_dbe_free_key_list(krb5_context, krb5_keylist_node *); + +void +krb5_dbe_free_actkvno_list(krb5_context, krb5_actkvno_node *); + +void +krb5_dbe_free_mkey_aux_list(krb5_context, krb5_mkey_aux_node *); + +void +krb5_dbe_free_tl_data(krb5_context, krb5_tl_data *); + +void +krb5_dbe_free_strings(krb5_context, krb5_string_attr *, int count); + +void +krb5_dbe_free_string(krb5_context, char *); + +/* Set *out to a stub alias entry pointing to target. */ +krb5_error_code +krb5_dbe_make_alias_entry(krb5_context context, krb5_const_principal alias, + krb5_const_principal target, krb5_db_entry **out); + +/* If entry contains a stub alias entry, set *target_out to the alias target. + * If not, set *target_out to NULL and return 0. */ +krb5_error_code +krb5_dbe_read_alias(krb5_context context, krb5_db_entry *entry, + krb5_principal *target_out); + +/* + * Register the KDB keytab type, allowing "KDB:" to be used as a keytab name. + * For this type to work, the context used for keytab operations must have an + * associated database handle (via krb5_db_open()). + */ +krb5_error_code krb5_db_register_keytab(krb5_context context); + +#define KRB5_KDB_DEF_FLAGS 0 + +#define KDB_MAX_DB_NAME 128 +#define KDB_REALM_SECTION "realms" +#define KDB_MODULE_POINTER "database_module" +#define KDB_MODULE_DEF_SECTION "dbdefaults" +#define KDB_MODULE_SECTION "dbmodules" +#define KDB_LIB_POINTER "db_library" +#define KDB_DATABASE_CONF_FILE DEFAULT_SECURE_PROFILE_PATH +#define KDB_DATABASE_ENV_PROF KDC_PROFILE_ENV + +#define KRB5_KDB_OPEN_RW 0 +#define KRB5_KDB_OPEN_RO 1 + +#define KRB5_KDB_OPT_SET_DB_NAME 0 +#define KRB5_KDB_OPT_SET_LOCK_MODE 1 + +/* + * This number indicates the date of the last incompatible change to the DAL. + * The maj_ver field of the module's vtable structure must match this version. + */ +#define KRB5_KDB_DAL_MAJOR_VERSION 9 + +/* + * Note the following when converting a module to DAL version 9: + * + * - get_authdata_info() and sign_authdata() have been removed, and issue_pac() + * has been added. + * + * - check_allowed_to_delegate() must handle a null proxy argument, returning + * success if server has any authorized delegation targets in the traditional + * scheme. + * + * - allowed_to_delegate_from() accepts a krb5_pac parameter (in place + * server_ad_info) for the impersonator's PAC. + * + * - check_allowed_to_delegate() and allowed_to_delegate_from() must return + * KRB5KDC_ERR_BADOPTION on authorization failure. + * + * - the KRB5_KDB_FLAG_ISSUE_PAC and KRB5_FLAG_CLIENT_REFERRALS_ONLY flags have + * been combined into KRB5_KDB_FLAG_CLIENT. + * + * - the KRB5_KDB_FLAG_CANONICALIZE flag has been renamed to + * KRB5_KDB_FLAG_REFERRAL_OK, and is only passed to get_principal() when a + * realm referral is allowed (AS client and TGS server lookups, when the + * CANONICALIZE option is requested or, for AS requests, when the client is + * an enterprise principal). As of DAL version 8 the KDB module should + * always canonicalize aliases within a realm; the KDC will decide whether to + * use the original or canonical principal. + */ + +/* + * A krb5_context can hold one database object. Modules should use + * krb5_db_set_context and krb5_db_get_context to store state associated with + * the database object. + * + * Some module functions are mandatory for KDC operation; others are optional + * or apply only to administrative operations. If a function is optional, a + * module can leave the function pointer as NULL. Alternatively, modules can + * return KRB5_PLUGIN_OP_NOTSUPP when asked to perform an inapplicable action. + * + * Some module functions have default implementations which will call back into + * the vtable interface. Leave these functions as NULL to use the default + * implementations. + * + * The documentation in these comments describes the DAL as it is currently + * implemented and used, not as it should be. So if anything seems off, that + * probably means the current state of things is off. + * + * Modules must allocate memory for principal entries, policy entries, and + * other structures using an allocator compatible with malloc() as seen by + * libkdb5 and libkrb5. Modules may link against libkdb5 and call + * krb5_db_alloc() to be certain that the same malloc implementation is used. + */ + +typedef struct _kdb_vftabl { + short int maj_ver; + short int min_ver; + + /* + * Mandatory: Invoked after the module library is loaded, when the first DB + * using the module is opened, across all contexts. + */ + krb5_error_code (*init_library)(void); + + /* + * Mandatory: Invoked before the module library is unloaded, after the last + * DB using the module is closed, across all contexts. + */ + krb5_error_code (*fini_library)(void); + + /* + * Mandatory: Initialize a database object. Profile settings should be + * read from conf_section inside KDB_MODULE_SECTION. db_args communicates + * command-line arguments for module-specific flags. mode will be one of + * KRB5_KDB_OPEN_{RW,RO} or'd with one of + * KRB5_KDB_SRV_TYPE_{KDC,ADMIN,PASSWD,OTHER}. + */ + krb5_error_code (*init_module)(krb5_context kcontext, char *conf_section, + char **db_args, int mode); + + /* + * Mandatory: Finalize the database object contained in a context. Free + * any state contained in the db_context pointer and null it out. + */ + krb5_error_code (*fini_module)(krb5_context kcontext); + + /* + * Optional: Initialize a database object while creating the underlying + * database. conf_section and db_args have the same meaning as in + * init_module. This function may return an error if the database already + * exists. Used by kdb5_util create. + * + * If db_args contains the value "temporary", the module should create an + * exclusively locked side copy of the database suitable for loading in a + * propagation from primary to replica. This side copy will later be + * promoted with promote_db, allowing complete updates of the DB with no + * loss in read availability. If the module cannot comply with this + * architecture, it should return an error. + */ + krb5_error_code (*create)(krb5_context kcontext, char *conf_section, + char **db_args); + + /* + * Optional: Destroy a database. conf_section and db_args have the same + * meaning as in init_module. Used by kdb5_util destroy. In current + * usage, the database is destroyed while open, so the module should handle + * that. + */ + krb5_error_code (*destroy)(krb5_context kcontext, char *conf_section, + char **db_args); + + /* + * Deprecated: No longer used as of krb5 1.10; can be removed in the next + * DAL revision. Modules should leave as NULL. + */ + krb5_error_code (*get_age)(krb5_context kcontext, char *db_name, + time_t *age); + + /* + * Optional: Lock the database, with semantics depending on the mode + * argument: + * + * KRB5_DB_LOCKMODE_SHARED: Lock may coexist with other shared locks. + * KRB5_DB_LOCKMODE_EXCLUSIVE: Lock may not coexist with other locks. + * KRB5_DB_LOCKMODE_PERMANENT: Exclusive lock surviving process exit. + * + * Used by the "kadmin lock" command, incremental propagation, and + * kdb5_util dump. Incremental propagation support requires shared locks + * to operate. kdb5_util dump will continue unlocked if the module returns + * KRB5_PLUGIN_OP_NOTSUPP. + */ + krb5_error_code (*lock)(krb5_context kcontext, int mode); + + /* Optional: Release a lock created with db_lock. */ + krb5_error_code (*unlock)(krb5_context kcontext); + + /* + * Mandatory: Set *entry to an allocated entry for the principal + * search_for. If the principal is not found, return KRB5_KDB_NOENTRY. + * + * The meaning of flags are as follows: + * + * KRB5_KDB_FLAG_REFERRAL_OK: Set by the KDC when looking up entries for an + * AS client with canonicalization requested or for an enterprise + * principal, or for a TGS request server with canonicalization + * requested. Determines whether the module should return out-of-realm + * referrals. + * + * KRB5_KDB_FLAG_CLIENT: Set by the KDC when looking up a client principal + * during an AS or TGS request. Affects how the module should return + * out-of-realm referrals. + * + * KRB5_KDB_FLAG_MAP_PRINCIPALS: Set by the KDC when looking up the client + * entry during TGS requests, except for S4U TGS requests and requests + * where the server entry has the KRB5_KDB_NO_AUTH_DATA_REQUIRED + * attribute. Indicates that the module should map foreign principals + * to local principals if it supports doing so. + * + * KRB5_KDB_FLAG_PROTOCOL_TRANSITION: Set by the KDC when looking up the + * client entry during an S4U2Self TGS request. This affects the PAC + * information which should be included when authorization data is + * generated; see the Microsoft S4U specification for details. + * + * KRB5_KDB_FLAG_CONSTRAINED_DELEGATION: Set by the KDC when looking up the + * client entry during an S4U2Proxy TGS request. Also affects PAC + * generation. + * + * KRB5_KDB_FLAG_CROSS_REALM: Set by the KDC after looking up a server + * entry during a TGS request, if the header ticket was issued by a + * different realm. + * + * KRB5_KDB_FLAG_ISSUING_REFERRAL: Set by the KDC after looking up a server + * entry during a TGS request, if the requested server principal is not + * part of the realm being served, and a referral or alternate TGT will + * be issued instead. + * + * A module may return an in-realm alias by setting (*entry)->princ to the + * canonical name. The KDC will decide based on the request whether to use + * the requested name or the canonical name in the issued ticket. + * + * A module can return a referral to another realm if flags contains + * KRB5_KDB_FLAG_REFERRAL_OK. If KRB5_KDB_FLAG_CLIENT is also set, the + * module should return a referral by simply filling in an out-of-realm + * name in (*entry)->princ and setting all other fields to NULL. + * Otherwise, the module should return the entry for the cross-realm TGS of + * the referred-to realm. + */ + krb5_error_code (*get_principal)(krb5_context kcontext, + krb5_const_principal search_for, + unsigned int flags, + krb5_db_entry **entry); + + /* + * Optional: Create or modify a principal entry. db_args communicates + * command-line arguments for module-specific flags. + * + * The mask field of an entry indicates the changed fields. Mask values + * are defined in kadmin's admin.h header. If KADM5_PRINCIPAL is set in + * the mask, the entry is new; otherwise it already exists. All fields of + * an entry are expected to contain correct values, regardless of whether + * they are specified in the mask, so it is acceptable for a module to + * ignore the mask and update the entire entry. + * + * If the module has its own representation of principal aliases, this + * method should recognize alias stub entries using krb5_dbe_read_alias() + * and should create the alias instead of storing the stub entry. + */ + krb5_error_code (*put_principal)(krb5_context kcontext, + krb5_db_entry *entry, char **db_args); + + /* + * Optional: Delete search_for from the database. If the principal did not + * exist, return KRB5_KDB_NOENTRY. If search_for is an alias, delete the + * alias, not the entry for the canonical principal. + */ + krb5_error_code (*delete_principal)(krb5_context kcontext, + krb5_const_principal search_for); + + /* + * Optional with default: Rename a principal. If the source principal does + * not exist, return KRB5_KDB_NOENTRY. If the target exists, return an + * error. This method will not be called if source is an alias. + * + * NOTE: If the module chooses to implement a custom function for renaming + * a principal instead of using the default, then rename operations will + * fail if iprop logging is enabled. + */ + krb5_error_code (*rename_principal)(krb5_context kcontext, + krb5_const_principal source, + krb5_const_principal target); + + /* + * Optional: For each principal entry in the database, invoke func with the + * arguments func_arg and the entry data. If match_entry is specified, the + * module may narrow the iteration to principal names matching that regular + * expression; a module may alternatively ignore match_entry. + * + * If the module has its own representation of principal aliases, this + * method should invoke func with a stub alias entry for each alias, + * created using krb5_dbe_make_alias_entry(). + */ + krb5_error_code (*iterate)(krb5_context kcontext, + char *match_entry, + int (*func)(krb5_pointer, krb5_db_entry *), + krb5_pointer func_arg, krb5_flags iterflags); + + /* + * Optional: Create a password policy entry. Return an error if the policy + * already exists. + */ + krb5_error_code (*create_policy)(krb5_context kcontext, + osa_policy_ent_t policy); + + /* + * Optional: Set *policy to the policy entry of the specified name. If the + * entry does not exist, return KRB5_KDB_NOENTRY. + */ + krb5_error_code (*get_policy)(krb5_context kcontext, char *name, + osa_policy_ent_t *policy); + + /* + * Optional: Modify an existing password policy entry to match the values + * in policy. Return an error if the policy does not already exist. + */ + krb5_error_code (*put_policy)(krb5_context kcontext, + osa_policy_ent_t policy); + + /* + * Optional: For each password policy entry in the database, invoke func + * with the arguments data and the entry data. If match_entry is + * specified, the module may narrow the iteration to policy names matching + * that regular expression; a module may alternatively ignore match_entry. + */ + krb5_error_code (*iter_policy)(krb5_context kcontext, char *match_entry, + osa_adb_iter_policy_func func, + void *data); + + /* + * Optional: Delete the password policy entry with the name policy. Return + * an error if the entry does not exist. + */ + krb5_error_code (*delete_policy)(krb5_context kcontext, char *policy); + + /* + * Optional with default: Retrieve a master keyblock from the stash file + * db_args, filling in *key and *kvno. mname is the name of the master + * principal for the realm. + * + * The default implementation reads the master keyblock from a keytab or + * old-format stash file. + */ + krb5_error_code (*fetch_master_key)(krb5_context kcontext, + krb5_principal mname, + krb5_keyblock *key, krb5_kvno *kvno, + char *db_args); + + /* + * Optional with default: Given a keyblock for some version of the + * database's master key, fetch the decrypted master key values from the + * database and store the list into *mkeys_list. The caller will free + * *mkeys_list using a libkdb5 function which uses the standard free() + * function, so the module must not use a custom allocator. + * + * The caller may not know the version number of the master key it has, in + * which case it will pass IGNORE_VNO. + * + * The default implementation ignores kvno and tries the key against the + * current master key data and all KRB5_TL_MKEY_AUX values, which contain + * copies of the master keys encrypted with old master keys. + */ + krb5_error_code (*fetch_master_key_list)(krb5_context kcontext, + krb5_principal mname, + const krb5_keyblock *key, + krb5_keylist_node **mkeys_list); + + /* + * Optional with default: Save a list of master keyblocks, obtained from + * fetch_master_key_list, into the stash file db_arg. The caller will set + * master_pwd to NULL, so the module should just ignore it. mname is the + * name of the master principal for the realm. + * + * The default implementation saves the list of master keys in a + * keytab-format file. + */ + krb5_error_code (*store_master_key_list)(krb5_context kcontext, + char *db_arg, + krb5_principal mname, + krb5_keylist_node *keylist, + char *master_pwd); + + /* + * Optional with default: Starting at position *start, scan the key data of + * a database entry for a key matching the enctype ktype, the salt type + * stype, and the version kvno. Store the resulting key into *kdatap and + * set *start to the position after the key found. If ktype is negative, + * match any enctype. If stype is negative, match any salt type. If kvno + * is zero or negative, find the most recent key version satisfying the + * other constraints. + */ + krb5_error_code (*dbe_search_enctype)(krb5_context kcontext, + krb5_db_entry *dbentp, + krb5_int32 *start, krb5_int32 ktype, + krb5_int32 stype, krb5_int32 kvno, + krb5_key_data **kdatap); + + + /* + * Optional with default: Change the key data for db_entry to include keys + * derived from the password passwd in each of the specified key-salt + * types, at version new_kvno. Discard the old key data if keepold is not + * set. + * + * The default implementation uses the keyblock master_key to encrypt each + * new key, via the function encrypt_key_data. + */ + krb5_error_code (*change_pwd)(krb5_context context, + krb5_keyblock *master_key, + krb5_key_salt_tuple *ks_tuple, + int ks_tuple_count, char *passwd, + int new_kvno, unsigned int keepold, + krb5_db_entry *db_entry); + + /* + * Optional: Promote a temporary database to be the live one. context must + * be initialized with an exclusively locked database created with the + * "temporary" db_arg. On success, the database object contained in + * context will be finalized. + * + * This method is used by kdb5_util load to replace the live database with + * minimal loss of read availability. + */ + krb5_error_code (*promote_db)(krb5_context context, char *conf_section, + char **db_args); + + /* + * Optional with default: Decrypt the key in key_data with master keyblock + * mkey, placing the result into dbkey. Copy the salt from key_data, if + * any, into keysalt. Either dbkey or keysalt may be left unmodified on + * successful return if key_data does not contain key or salt information. + * + * The default implementation expects the encrypted key (in krb5_c_encrypt + * format) to be stored in key_data_contents[0], with length given by + * key_data_length[0]. If key_data_ver is 2, it expects the salt to be + * stored, unencrypted, in key_data_contents[1], with length given by + * key_data_length[1]. + */ + krb5_error_code (*decrypt_key_data)(krb5_context kcontext, + const krb5_keyblock *mkey, + const krb5_key_data *key_data, + krb5_keyblock *dbkey, + krb5_keysalt *keysalt); + + /* + * Optional with default: Encrypt dbkey with master keyblock mkey, placing + * the result into key_data along with keysalt. + * + * The default implementation stores the encrypted key (in krb5_c_encrypt + * format) in key_data_contents[0] and the length in key_data_length[0]. + * If keysalt is specified, it sets key_data_ver to 2, and stores the salt + * in key_data_contents[1] and its length in key_data_length[1]. If + * keysalt is not specified, key_data_ver is set to 1. + */ + krb5_error_code (*encrypt_key_data)(krb5_context kcontext, + const krb5_keyblock *mkey, + const krb5_keyblock *dbkey, + const krb5_keysalt *keysalt, + int keyver, krb5_key_data *key_data); + + /* + * Optional: Perform a policy check on a cross-realm ticket's transited + * field. Return 0 if the check authoritatively succeeds, + * KRB5_PLUGIN_NO_HANDLE to use the core transited-checking mechanisms, or + * another error (other than KRB5_PLUGIN_OP_NOTSUPP) if the check fails. + */ + krb5_error_code (*check_transited_realms)(krb5_context kcontext, + const krb5_data *tr_contents, + const krb5_data *client_realm, + const krb5_data *server_realm); + + /* + * Optional: Perform a policy check on an AS request, in addition to the + * standard policy checks. Return 0 if the AS request is allowed. If the + * AS request is not allowed: + * - Place a short string literal into *status. + * - If desired, place data into e_data. Any data placed here will be + * freed by the caller using the standard free function. + * - Return an appropriate error (such as KRB5KDC_ERR_POLICY). + */ + krb5_error_code (*check_policy_as)(krb5_context kcontext, + krb5_kdc_req *request, + krb5_db_entry *client, + krb5_db_entry *server, + krb5_timestamp kdc_time, + const char **status, + krb5_pa_data ***e_data); + + /* + * Optional: Perform a policy check on a TGS request, in addition to the + * standard policy checks. Return 0 if the TGS request is allowed. If the + * TGS request is not allowed: + * - Place a short string literal into *status. + * - If desired, place data into e_data. Any data placed here will be + * freed by the caller using the standard free function. + * - Return an appropriate error (such as KRB5KDC_ERR_POLICY). + * The input parameter ticket contains the TGT used in the TGS request. + */ + krb5_error_code (*check_policy_tgs)(krb5_context kcontext, + krb5_kdc_req *request, + krb5_db_entry *server, + krb5_ticket *ticket, + const char **status, + krb5_pa_data ***e_data); + + /* + * Optional: This method informs the module of a successful or unsuccessful + * AS request. + */ + void (*audit_as_req)(krb5_context kcontext, krb5_kdc_req *request, + const krb5_address *local_addr, + const krb5_address *remote_addr, + krb5_db_entry *client, krb5_db_entry *server, + krb5_timestamp authtime, krb5_error_code error_code); + + /* Note: there is currently no method for auditing TGS requests. */ + + /* + * Optional: This method informs the module of a request to reload + * configuration or other state (that is, the KDC received a SIGHUP). + */ + void (*refresh_config)(krb5_context kcontext); + + /* + * Optional: Perform a policy check on server being allowed to obtain + * tickets from client to proxy. If proxy is NULL, check if server has any + * authorized delegation targets (client will also be NULL in this case). + * (Note that proxy is the target of the delegation, not the delegating + * service; the term "proxy" is from the viewpoint of the delegating + * service asking another service to perform some of its work in the + * authentication context of the client. This terminology comes from the + * Microsoft S4U protocol documentation.) Return 0 if policy allows + * delegation to the specified target (or to any target if proxy is NULL), + * or KRB5KDC_ERR_BADOPTION if not. If this method is not implemented, all + * S4U2Proxy delegation requests will be rejected. + */ + krb5_error_code (*check_allowed_to_delegate)(krb5_context context, + krb5_const_principal client, + const krb5_db_entry *server, + krb5_const_principal proxy); + + /* + * Optional: Free the e_data pointer of a database entry. If this method + * is not implemented, the e_data pointer in principal entries will be + * freed with free() as seen by libkdb5. + */ + void (*free_principal_e_data)(krb5_context kcontext, krb5_octet *e_data); + + /* + * Optional: get a client principal entry based on an X.509 certificate. + * + * If flags include KRB5_KDB_FLAG_REFERRAL_OK, the certificate was + * presented in an AS request. princ->realm indicates the request realm, + * but the data components should be ignored. The module can return an + * out-of-realm client referral as it would for get_principal(). + * + * Otherwise, princ is from a TGS request. If it contains data components + * (and not just a realm), the module should verify that it is the same as + * the lookup result for client_cert. The module should not return a + * referral. + */ + krb5_error_code (*get_s4u_x509_principal)(krb5_context kcontext, + const krb5_data *client_cert, + krb5_const_principal princ, + unsigned int flags, + krb5_db_entry **entry_out); + + /* + * Optional: Perform a policy check on server being allowed to obtain + * tickets from client to proxy. This method is similar to + * check_allowed_to_delegate, but it operates on the target server DB entry + * (called "proxy" here as in Microsoft's protocol documentation) rather + * than the intermediate server entry. server_pac is the verified PAC from + * the authdata of the intermediate server. Return 0 if policy allows the + * delegation, or KRB5KDC_ERR_BADOPTION if not. + * + * This method is called for S4U2Proxy requests and implements the + * resource-based constrained delegation variant, which can support + * cross-realm delegation. If this method is not implemented or if it + * returns a policy error, the KDC will fall back to + * check_allowed_to_delegate if the intermediate and target servers are in + * the same realm and the evidence ticket is forwardable. + */ + krb5_error_code (*allowed_to_delegate_from)(krb5_context context, + krb5_const_principal client, + krb5_const_principal server, + krb5_pac server_pac, + const krb5_db_entry *proxy); + + /* + * Optional: Add buffers to new_pac using krb5_pac_add_buffer() before it + * is signed. + * + * The caller will handle the following buffer types, so do not copy or add + * them: + * + * KRB5_PAC_SERVER_CHECKSUM + * KRB5_PAC_PRIVSVR_CHECKSUM + * KRB5_PAC_TICKET_CHECKSUM + * KRB5_PAC_CLIENT_INFO + * KRB5_PAC_DELEGATION_INFO + * + * For TGS requests, old_pac is the PAC of the header ticket, except when + * KRB5_KDB_FLAG_CONTRAINED_DELEGATION is present in flags, in which case + * it is the PAC of the second ticket. If + * KRB5_KDB_FLAG_PROTOCOL_TRANSITION is present in flags and client is not + * NULL, old_pac is the PAC of the requesting service, not the subject of + * the S4U2Self request, and its buffers should not be copied into new_pac. + * The signatures and PAC_CLIENT_INFO of old_pac have been verified by the + * caller. + * + * If replaced_reply_key is not null, the request is an AS request and the + * reply key was replaced by a preauth mechanism such as PKINIT, meaning + * the Kerberos password or long-term key was not used. The module may use + * this key to encrypt a PAC_CREDENTIALS_INFO buffer containing credentials + * (such as an NTLM hash) that the client would ordinarily derive from the + * Kerberos password or long-term key. + * + * server is the database entry of the server the ticket will be issued to, + * which may be a referral TGS. + * + * signing_krbtgt is the database entry of the krbtgt principal used to + * verify old_pac (or null if old_pac is null). If + * KRB5_KDB_FLAG_CROSS_REALM is present in flags, this entry will be an + * incoming cross-realm TGS, and the PAC fields should undergo appropriate + * filtering based on the trust level of the cross-realm relationship. + * + * auth_indicators points to NULL or a null-terminated list of krb5_data + * pointers, each containing an authentication indicator (RFC 8129). The + * method may modify this list, or free it and replace *auth_indicators + * with NULL, to change which auth indicators will be included in the + * ticket. + */ + krb5_error_code (*issue_pac)(krb5_context context, unsigned int flags, + krb5_db_entry *client, + krb5_keyblock *replaced_reply_key, + krb5_db_entry *server, + krb5_db_entry *signing_krbtgt, + krb5_timestamp authtime, krb5_pac old_pac, + krb5_pac new_pac, + krb5_data ***auth_indicators); + + /* End of minor version 0 for major version 9. */ +} kdb_vftabl; + +#endif /* !defined(_WIN32) */ + +#endif /* KRB5_KDB5__ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krad.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krad.h new file mode 100644 index 0000000000000000000000000000000000000000..c347df5aa27f3f915ed7d63979234058e5b0d388 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krad.h @@ -0,0 +1,277 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright 2013 Red Hat, 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: + * + * 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. + * + * 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. + */ + +/* + * This API is not considered as stable as the main krb5 API. + * + * - We may make arbitrary incompatible changes between feature releases + * (e.g. from 1.12 to 1.13). + * - We will make some effort to avoid making incompatible changes for + * bugfix releases, but will make them if necessary. + */ + +#ifndef KRAD_H_ +#define KRAD_H_ + +#include +#include +#include +#include + +#define KRAD_PACKET_SIZE_MAX 4096 + +#define KRAD_SERVICE_TYPE_LOGIN 1 +#define KRAD_SERVICE_TYPE_FRAMED 2 +#define KRAD_SERVICE_TYPE_CALLBACK_LOGIN 3 +#define KRAD_SERVICE_TYPE_CALLBACK_FRAMED 4 +#define KRAD_SERVICE_TYPE_OUTBOUND 5 +#define KRAD_SERVICE_TYPE_ADMINISTRATIVE 6 +#define KRAD_SERVICE_TYPE_NAS_PROMPT 7 +#define KRAD_SERVICE_TYPE_AUTHENTICATE_ONLY 8 +#define KRAD_SERVICE_TYPE_CALLBACK_NAS_PROMPT 9 +#define KRAD_SERVICE_TYPE_CALL_CHECK 10 +#define KRAD_SERVICE_TYPE_CALLBACK_ADMINISTRATIVE 11 + +#define KRAD_ATTR_USER_NAME 1 +#define KRAD_ATTR_USER_PASSWORD 2 +#define KRAD_ATTR_SERVICE_TYPE 6 +#define KRAD_ATTR_NAS_IDENTIFIER 32 +#define KRAD_ATTR_PROXY_STATE 33 +#define KRAD_ATTR_MESSAGE_AUTHENTICATOR 80 + +#define KRAD_CODE_ACCESS_REQUEST 1 +#define KRAD_CODE_ACCESS_ACCEPT 2 +#define KRAD_CODE_ACCESS_REJECT 3 +#define KRAD_CODE_ACCESS_CHALLENGE 11 + +typedef struct krad_attrset_st krad_attrset; +typedef struct krad_packet_st krad_packet; +typedef struct krad_client_st krad_client; +typedef unsigned char krad_code; +typedef unsigned char krad_attr; + +/* Called when a response is received or the request times out. */ +typedef void +(*krad_cb)(krb5_error_code retval, const krad_packet *request, + const krad_packet *response, void *data); + +/* + * Called to iterate over a set of requests. Either the callback will be + * called until it returns NULL, or it will be called with cancel = TRUE to + * terminate in the middle of an iteration. + */ +typedef const krad_packet * +(*krad_packet_iter_cb)(void *data, krb5_boolean cancel); + +/* + * Code + */ + +/* Convert a code name to its number. Only works for codes defined + * by RFC 2875 or 2882. Returns 0 if the name was not found. */ +krad_code +krad_code_name2num(const char *name); + +/* Convert a code number to its name. Only works for attributes defined + * by RFC 2865 or 2882. Returns NULL if the name was not found. */ +const char * +krad_code_num2name(krad_code code); + +/* + * Attribute + */ + +/* Convert an attribute name to its number. Only works for attributes defined + * by RFC 2865. Returns 0 if the name was not found. */ +krad_attr +krad_attr_name2num(const char *name); + +/* Convert an attribute number to its name. Only works for attributes defined + * by RFC 2865. Returns NULL if the name was not found. */ +const char * +krad_attr_num2name(krad_attr type); + +/* + * Attribute set + */ + +/* Create a new attribute set. */ +krb5_error_code +krad_attrset_new(krb5_context ctx, krad_attrset **set); + +/* Create a deep copy of an attribute set. */ +krb5_error_code +krad_attrset_copy(const krad_attrset *set, krad_attrset **copy); + +/* Free an attribute set. */ +void +krad_attrset_free(krad_attrset *set); + +/* Add an attribute to a set. */ +krb5_error_code +krad_attrset_add(krad_attrset *set, krad_attr type, const krb5_data *data); + +/* Add a four-octet unsigned number attribute to the given set. */ +krb5_error_code +krad_attrset_add_number(krad_attrset *set, krad_attr type, krb5_ui_4 num); + +/* Delete the specified attribute. */ +void +krad_attrset_del(krad_attrset *set, krad_attr type, size_t indx); + +/* Get the specified attribute. */ +const krb5_data * +krad_attrset_get(const krad_attrset *set, krad_attr type, size_t indx); + +/* + * Packet + */ + +/* Determine the bytes needed from the socket to get the whole packet. Don't + * cache the return value as it can change! Returns -1 on EBADMSG. */ +ssize_t +krad_packet_bytes_needed(const krb5_data *buffer); + +/* Free a packet. */ +void +krad_packet_free(krad_packet *pkt); + +/* + * Create a new request packet. + * + * This function takes the attributes specified in set and converts them into a + * radius packet. The packet will have a randomized id. If cb is not NULL, it + * will be called passing data as the argument to iterate over a set of + * outstanding requests. In this case, the id will be both random and unique + * across the set of requests. + */ +krb5_error_code +krad_packet_new_request(krb5_context ctx, const char *secret, krad_code code, + const krad_attrset *set, krad_packet_iter_cb cb, + void *data, krad_packet **request); + +/* + * Create a new response packet. + * + * This function is similar to krad_packet_new_requst() except that it crafts a + * packet in response to a request packet. This new packet will borrow values + * from the request such as the id and the authenticator. + */ +krb5_error_code +krad_packet_new_response(krb5_context ctx, const char *secret, krad_code code, + const krad_attrset *set, const krad_packet *request, + krad_packet **response); + +/* + * Decode a request radius packet from krb5_data. + * + * The resulting decoded packet will be a request packet stored in *reqpkt. + * + * If cb is NULL, *duppkt will always be NULL. + * + * If cb is not NULL, it will be called (with the data argument) to iterate + * over a set of requests currently being processed. In this case, if the + * packet is a duplicate of an already received request, the original request + * will be set in *duppkt. + */ +krb5_error_code +krad_packet_decode_request(krb5_context ctx, const char *secret, + const krb5_data *buffer, krad_packet_iter_cb cb, + void *data, const krad_packet **duppkt, + krad_packet **reqpkt); + +/* + * Decode a response radius packet from krb5_data. + * + * The resulting decoded packet will be a response packet stored in *rsppkt. + * + * If cb is NULL, *reqpkt will always be NULL. + * + * If cb is not NULL, it will be called (with the data argument) to iterate + * over a set of requests awaiting responses. In this case, if the response + * packet matches one of these requests, the original request will be set in + * *reqpkt. + */ +krb5_error_code +krad_packet_decode_response(krb5_context ctx, const char *secret, + const krb5_data *buffer, krad_packet_iter_cb cb, + void *data, const krad_packet **reqpkt, + krad_packet **rsppkt); + +/* Encode packet. */ +const krb5_data * +krad_packet_encode(const krad_packet *pkt); + +/* Get the code for the given packet. */ +krad_code +krad_packet_get_code(const krad_packet *pkt); + +/* Get the specified attribute. */ +const krb5_data * +krad_packet_get_attr(const krad_packet *pkt, krad_attr type, size_t indx); + +/* + * Client + */ + +/* Create a new client. */ +krb5_error_code +krad_client_new(krb5_context kctx, verto_ctx *vctx, krad_client **client); + +/* Free the client. */ +void +krad_client_free(krad_client *client); + +/* + * Send a request to a radius server. + * + * The remote host may be specified by one of the following formats: + * - /path/to/unix.socket + * - IPv4 + * - IPv4:port + * - IPv4:service + * - [IPv6] + * - [IPv6]:port + * - [IPv6]:service + * - hostname + * - hostname:port + * - hostname:service + * + * The timeout parameter (milliseconds) is the total timeout across all remote + * hosts (when DNS returns multiple entries) and all retries. For stream + * sockets, the retries parameter is ignored and no retries are performed. + * + * The cb function will be called with the data argument when either a response + * is received or the request times out on all possible remote hosts. + */ +krb5_error_code +krad_client_send(krad_client *rc, krad_code code, const krad_attrset *attrs, + const char *remote, const char *secret, int timeout, + size_t retries, krad_cb cb, void *data); + +#endif /* KRAD_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5.h new file mode 100644 index 0000000000000000000000000000000000000000..62ef9bb957fc0c216407484472e0da9f7e3968b3 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5.h @@ -0,0 +1,8 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* The MIT Kerberos header file krb5.h used to live here. + + As of the 1.5 release, we're installing multiple Kerberos headers, + so they're all moving to a krb5/ subdirectory. This file is + present just to keep old software still compiling. Please update + your code to use the new path for the header. */ +#include diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/ccselect_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/ccselect_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..ff9631311603bc219df4cbe4cc9908eaa61988ba --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/ccselect_plugin.h @@ -0,0 +1,105 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2011 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* + * Declarations for credential cache selection module implementors. + * + * The ccselect pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 1. + * + * Credential cache selection modules should define a function named + * ccselect__initvt, matching the signature: + * + * krb5_error_code + * ccselect_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_ccselect_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_CCSELECT_PLUGIN_H +#define KRB5_CCSELECT_PLUGIN_H + +#include +#include + +/* An abstract type for credential cache selection module data. */ +typedef struct krb5_ccselect_moddata_st *krb5_ccselect_moddata; + +#define KRB5_CCSELECT_PRIORITY_AUTHORITATIVE 2 +#define KRB5_CCSELECT_PRIORITY_HEURISTIC 1 + +/*** Method type declarations ***/ + +/* + * Mandatory: Initialize module data and set *priority_out to one of the + * KRB5_CCSELECT_PRIORITY constants above. Authoritative modules will be + * consulted before heuristic ones. + */ +typedef krb5_error_code +(*krb5_ccselect_init_fn)(krb5_context context, krb5_ccselect_moddata *data_out, + int *priority_out); + +/* + * Mandatory: Select a cache based on a server principal. Return 0 on success, + * with *cache_out set to the selected cache and *princ_out set to its default + * principal. Return KRB5_PLUGIN_NO_HANDLE to defer to other modules. Return + * KRB5_CC_NOTFOUND with *princ_out set if the client principal can be + * authoritatively determined but no cache exists for it. Return other errors + * as appropriate. + */ +typedef krb5_error_code +(*krb5_ccselect_choose_fn)(krb5_context context, krb5_ccselect_moddata data, + krb5_principal server, krb5_ccache *cache_out, + krb5_principal *princ_out); + +/* Optional: Release resources used by module data. */ +typedef void +(*krb5_ccselect_fini_fn)(krb5_context context, krb5_ccselect_moddata data); + +/*** vtable declarations **/ + +/* Credential cache selection plugin vtable for major version 1. */ +typedef struct krb5_ccselect_vtable_st { + const char *name; /* Mandatory: name of module. */ + krb5_ccselect_init_fn init; + krb5_ccselect_choose_fn choose; + krb5_ccselect_fini_fn fini; + /* Minor version 1 ends here. */ +} *krb5_ccselect_vtable; + +#endif /* KRB5_CCSELECT_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/certauth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/certauth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..bc8c88ac9483a11de9d0a91385da496d9c033641 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/certauth_plugin.h @@ -0,0 +1,148 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* include/krb5/certauth_plugin.h - certauth plugin header. */ +/* + * Copyright (C) 2017 by Red Hat, 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. + * + * 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. + */ + +/* + * Declarations for certauth plugin module implementors. + * + * The certauth pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 2. + * + * certauth plugin modules should define a function named + * certauth__initvt, matching the signature: + * + * krb5_error_code + * certauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_certauth_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_CERTAUTH_PLUGIN_H +#define KRB5_CERTAUTH_PLUGIN_H + +#include +#include + +/* Abstract module data type. */ +typedef struct krb5_certauth_moddata_st *krb5_certauth_moddata; + +/* A module can optionally include to inspect the client principal + * entry when authorizing a request. */ +struct _krb5_db_entry_new; + +/* + * Optional: Initialize module data. + */ +typedef krb5_error_code +(*krb5_certauth_init_fn)(krb5_context context, + krb5_certauth_moddata *moddata_out); + +/* + * Optional: Initialize module data. Supersedes init if present. + */ +typedef krb5_error_code +(*krb5_certauth_init_ex_fn)(krb5_context context, const char *const *realmlist, + krb5_certauth_moddata *moddata_out); + +/* + * Optional: Clean up the module data. + */ +typedef void +(*krb5_certauth_fini_fn)(krb5_context context, krb5_certauth_moddata moddata); + +/* + * Mandatory: decode cert as an X.509 certificate and determine whether it is + * authorized to authenticate as the requested client principal princ using + * PKINIT. Return 0 or KRB5_CERTAUTH_HWAUTH if the certificate is authorized. + * Otherwise return one of the following error codes: + * + * - KRB5KDC_ERR_CLIENT_NAME_MISMATCH - incorrect SAN value + * - KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE - incorrect EKU + * - KRB5KDC_ERR_CERTIFICATE_MISMATCH - other extension error + * - KRB5_PLUGIN_NO_HANDLE or KRB5_CERTAUTH_HWAUTH_PASS - the module has no + * opinion about whether cert is authorized + * + * Returning KRB5_CERTAUTH_HWAUTH will authorize the PKINIT authentication and + * cause the hw-authent flag to be set in the issued ticket (new in release + * 1.19). Returning KRB5_CERTAUTH_HWAUTH_PASS does not authorize the PKINIT + * authentication, but causes the hw-authent flag to be set if another module + * authorizes it (new in release 1.20) + * + * - opts is used by built-in modules to receive internal data, and must be + * ignored by other modules. + * - db_entry receives the client principal database entry, and can be ignored + * by modules that do not link with libkdb5. + * - *authinds_out optionally returns a null-terminated list of authentication + * indicator strings upon KRB5_PLUGIN_NO_HANDLE or accepted authorization. + */ +typedef krb5_error_code +(*krb5_certauth_authorize_fn)(krb5_context context, + krb5_certauth_moddata moddata, + const uint8_t *cert, size_t cert_len, + krb5_const_principal princ, const void *opts, + const struct _krb5_db_entry_new *db_entry, + char ***authinds_out); + +/* + * Free indicators allocated by a module. Mandatory if authorize returns + * authentication indicators. + */ +typedef void +(*krb5_certauth_free_indicator_fn)(krb5_context context, + krb5_certauth_moddata moddata, + char **authinds); + +typedef struct krb5_certauth_vtable_st { + const char *name; + krb5_certauth_init_fn init; + krb5_certauth_fini_fn fini; + krb5_certauth_authorize_fn authorize; + krb5_certauth_free_indicator_fn free_ind; + /* Minor version 1 ends here. */ + + krb5_certauth_init_ex_fn init_ex; + /* Minor version 2 ends here. */ +} *krb5_certauth_vtable; + +#endif /* KRB5_CERTAUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/clpreauth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/clpreauth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..8832a687e90b82fd7dafb17e19ab533d90473310 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/clpreauth_plugin.h @@ -0,0 +1,346 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (c) 2006 Red Hat, Inc. + * Portions copyright (c) 2006, 2011 Massachusetts Institute of Technology + * 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 of Red Hat, Inc., 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 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. + */ + +/* + * Declarations for clpreauth plugin module implementors. + * + * The clpreauth interface has a single supported major version, which is + * 1. Major version 1 has a current minor version of 2. clpreauth modules + * should define a function named clpreauth__initvt, matching + * the signature: + * + * krb5_error_code + * clpreauth_modname_initvt(krb5_context context, int maj_ver, + * int min_ver, krb5_plugin_vtable vtable); + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for the interface and maj_ver: + * maj_ver == 1: Cast to krb5_clpreauth_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_CLPREAUTH_PLUGIN_H +#define KRB5_CLPREAUTH_PLUGIN_H + +#include +#include + +/* clpreauth mechanism property flags */ + +/* Provides a real answer which we can send back to the KDC. The client + * assumes that one real answer will be enough. */ +#define PA_REAL 0x00000001 + +/* Doesn't provide a real answer, but must be given a chance to run before any + * REAL mechanism callbacks. */ +#define PA_INFO 0x00000002 + +/* Abstract type for a client request information handle. */ +typedef struct krb5_clpreauth_rock_st *krb5_clpreauth_rock; + +/* Abstract types for module data and per-request module data. */ +typedef struct krb5_clpreauth_moddata_st *krb5_clpreauth_moddata; +typedef struct krb5_clpreauth_modreq_st *krb5_clpreauth_modreq; + +/* Before using a callback after version 1, modules must check the vers + * field of the callback structure. */ +typedef struct krb5_clpreauth_callbacks_st { + int vers; + + /* + * If an AS-REP has been received, return the enctype of the AS-REP + * encrypted part. Otherwise return the enctype chosen from etype-info, or + * the first requested enctype if no etype-info was received. + */ + krb5_enctype (*get_etype)(krb5_context context, krb5_clpreauth_rock rock); + + /* Get a pointer to the FAST armor key, or NULL if the client is not using + * FAST. The returned pointer is an alias and should not be freed. */ + krb5_keyblock *(*fast_armor)(krb5_context context, + krb5_clpreauth_rock rock); + + /* + * Get a pointer to the client-supplied reply key, possibly invoking the + * prompter to ask for a password if this has not already been done. The + * returned pointer is an alias and should not be freed. + */ + krb5_error_code (*get_as_key)(krb5_context context, + krb5_clpreauth_rock rock, + krb5_keyblock **keyblock); + + /* Replace the reply key to be used to decrypt the AS response. */ + krb5_error_code (*set_as_key)(krb5_context context, + krb5_clpreauth_rock rock, + const krb5_keyblock *keyblock); + + /* End of version 1 clpreauth callbacks. */ + + /* + * Get the current time for use in a preauth response. If + * allow_unauth_time is true and the library has been configured to allow + * it, the current time will be offset using unauthenticated timestamp + * information received from the KDC in the preauth-required error, if one + * has been received. Otherwise, the timestamp in a preauth-required error + * will only be used if it is protected by a FAST channel. Only set + * allow_unauth_time if using an unauthenticated time offset would not + * create a security issue. + */ + krb5_error_code (*get_preauth_time)(krb5_context context, + krb5_clpreauth_rock rock, + krb5_boolean allow_unauth_time, + krb5_timestamp *time_out, + krb5_int32 *usec_out); + + /* Set a question to be answered by the responder and optionally provide + * a challenge. */ + krb5_error_code (*ask_responder_question)(krb5_context context, + krb5_clpreauth_rock rock, + const char *question, + const char *challenge); + + /* Get an answer from the responder, or NULL if the question was + * unanswered. */ + const char *(*get_responder_answer)(krb5_context context, + krb5_clpreauth_rock rock, + const char *question); + + /* Indicate interest in the AS key through the responder interface. */ + void (*need_as_key)(krb5_context context, krb5_clpreauth_rock rock); + + /* + * Get a configuration/state item from an input ccache, which may allow it + * to retrace the steps it took last time. The returned data string is an + * alias and should not be freed. + */ + const char *(*get_cc_config)(krb5_context context, + krb5_clpreauth_rock rock, const char *key); + + /* + * Set a configuration/state item which will be recorded to an output + * ccache, if the calling application supplied one. Both key and data + * should be valid UTF-8 text. + */ + krb5_error_code (*set_cc_config)(krb5_context context, + krb5_clpreauth_rock rock, + const char *key, const char *data); + + /* End of version 2 clpreauth callbacks (added in 1.11). */ + + /* + * Prevent further fallbacks to other preauth mechanisms if the KDC replies + * with an error. (The module itself can still respond to errors with its + * tryagain method, or continue after KDC_ERR_MORE_PREAUTH_DATA_REQUIRED + * errors with its process method.) A module should invoke this callback + * from the process method when it generates an authenticated request using + * credentials; often this will be the first or only client message + * generated by the mechanism. + */ + void (*disable_fallback)(krb5_context context, krb5_clpreauth_rock rock); + + /* End of version 3 clpreauth callbacks (added in 1.17). */ +} *krb5_clpreauth_callbacks; + +/* + * Optional: per-plugin initialization/cleanup. The init function is called by + * libkrb5 when the plugin is loaded, and the fini function is called before + * the plugin is unloaded. These may be called multiple times in case the + * plugin is used in multiple contexts. The returned context lives the + * lifetime of the krb5_context. + */ +typedef krb5_error_code +(*krb5_clpreauth_init_fn)(krb5_context context, + krb5_clpreauth_moddata *moddata_out); +typedef void +(*krb5_clpreauth_fini_fn)(krb5_context context, + krb5_clpreauth_moddata moddata); + +/* + * Optional (mandatory before MIT krb5 1.12): pa_type will be a member of the + * vtable's pa_type_list. Return PA_REAL if pa_type is a real + * preauthentication type or PA_INFO if it is an informational type. If this + * function is not defined in 1.12 or later, all pa_type values advertised by + * the module will be assumed to be real. + */ +typedef int +(*krb5_clpreauth_get_flags_fn)(krb5_context context, krb5_preauthtype pa_type); + +/* + * Optional: per-request initialization/cleanup. The request_init function is + * called when beginning to process a get_init_creds request and the + * request_fini function is called when processing of the request is complete. + * This is optional. It may be called multiple times in the lifetime of a + * krb5_context. + */ +typedef void +(*krb5_clpreauth_request_init_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_clpreauth_modreq *modreq_out); +typedef void +(*krb5_clpreauth_request_fini_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_clpreauth_modreq modreq); + +/* + * Optional: process server-supplied data in pa_data and set responder + * questions. + * + * encoded_previous_request may be NULL if there has been no previous request + * in the AS exchange. + */ +typedef krb5_error_code +(*krb5_clpreauth_prep_questions_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_clpreauth_modreq modreq, + krb5_get_init_creds_opt *opt, + krb5_clpreauth_callbacks cb, + krb5_clpreauth_rock rock, + krb5_kdc_req *request, + krb5_data *encoded_request_body, + krb5_data *encoded_previous_request, + krb5_pa_data *pa_data); + +/* + * Mandatory: process server-supplied data in pa_data and return created data + * in pa_data_out. Also called after the AS-REP is received if the AS-REP + * includes preauthentication data of the associated type. + * + * as_key contains the client-supplied key if known, or an empty keyblock if + * not. If it is empty, the module may use gak_fct to fill it in. + * + * encoded_previous_request may be NULL if there has been no previous request + * in the AS exchange. + */ +typedef krb5_error_code +(*krb5_clpreauth_process_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_clpreauth_modreq modreq, + krb5_get_init_creds_opt *opt, + krb5_clpreauth_callbacks cb, + krb5_clpreauth_rock rock, + krb5_kdc_req *request, + krb5_data *encoded_request_body, + krb5_data *encoded_previous_request, + krb5_pa_data *pa_data, + krb5_prompter_fct prompter, void *prompter_data, + krb5_pa_data ***pa_data_out); + +/* + * Optional: Attempt to use error and error_padata to try to recover from the + * given error. To work with both FAST and non-FAST errors, an implementation + * should generally consult error_padata rather than decoding error->e_data. + * For non-FAST errors, it contains the e_data decoded as either pa-data or + * typed-data. + * + * If this function is provided, and it returns 0 and stores data in + * pa_data_out, then the client library will retransmit the request. + */ +typedef krb5_error_code +(*krb5_clpreauth_tryagain_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_clpreauth_modreq modreq, + krb5_get_init_creds_opt *opt, + krb5_clpreauth_callbacks cb, + krb5_clpreauth_rock rock, + krb5_kdc_req *request, + krb5_data *encoded_request_body, + krb5_data *encoded_previous_request, + krb5_preauthtype pa_type, + krb5_error *error, + krb5_pa_data **error_padata, + krb5_prompter_fct prompter, void *prompter_data, + krb5_pa_data ***pa_data_out); + +/* + * Optional: receive krb5_get_init_creds_opt information. The attr and value + * information supplied should be copied into moddata by the module if it + * wishes to reference it after returning from this call. + */ +typedef krb5_error_code +(*krb5_clpreauth_supply_gic_opts_fn)(krb5_context context, + krb5_clpreauth_moddata moddata, + krb5_get_init_creds_opt *opt, + const char *attr, const char *value); + +typedef struct krb5_clpreauth_vtable_st { + /* Mandatory: name of module. */ + const char *name; + + /* Mandatory: pointer to zero-terminated list of pa_types which this module + * can provide services for. */ + krb5_preauthtype *pa_type_list; + + /* Optional: pointer to zero-terminated list of enc_types which this module + * claims to add support for. */ + krb5_enctype *enctype_list; + + krb5_clpreauth_init_fn init; + krb5_clpreauth_fini_fn fini; + krb5_clpreauth_get_flags_fn flags; + krb5_clpreauth_request_init_fn request_init; + krb5_clpreauth_request_fini_fn request_fini; + krb5_clpreauth_process_fn process; + krb5_clpreauth_tryagain_fn tryagain; + krb5_clpreauth_supply_gic_opts_fn gic_opts; + /* Minor version 1 ends here. */ + + krb5_clpreauth_prep_questions_fn prep_questions; + /* Minor version 2 ends here. */ +} *krb5_clpreauth_vtable; + +/* + * This function allows a clpreauth plugin to obtain preauth options. The + * preauth_data returned from this function should be freed by calling + * krb5_get_init_creds_opt_free_pa(). + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_get_pa(krb5_context context, + krb5_get_init_creds_opt *opt, + int *num_preauth_data, + krb5_gic_opt_pa_data **preauth_data); + +/* + * This function frees the preauth_data that was returned by + * krb5_get_init_creds_opt_get_pa(). + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_free_pa(krb5_context context, + int num_preauth_data, + krb5_gic_opt_pa_data *preauth_data); + +#endif /* KRB5_CLPREAUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/hostrealm_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/hostrealm_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..5012c8cb1cedb2b983bf60efc707e8a954c7a121 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/hostrealm_plugin.h @@ -0,0 +1,135 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2013 by the Massachusetts Institute of Technology. + * 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. + */ + +/* + * Declarations for hostrealm plugin module implementors. + * + * The hostrealm pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 1. + * + * Hostrealm plugin modules should define a function named + * hostrealm__initvt, matching the signature: + * + * krb5_error_code + * hostrealm_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_hostrealm_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_HOSTREALM_PLUGIN_H +#define KRB5_HOSTREALM_PLUGIN_H + +#include +#include + +/* An abstract type for hostrealm module data. */ +typedef struct krb5_hostrealm_moddata_st *krb5_hostrealm_moddata; + +/*** Method type declarations ***/ + +/* Optional: Initialize module data. */ +typedef krb5_error_code +(*krb5_hostrealm_init_fn)(krb5_context context, + krb5_hostrealm_moddata *data); + +/* + * Optional: Determine the possible realms of a hostname, using only secure, + * authoritative mechanisms (ones which should be used prior to trying + * referrals when getting a service ticket). Return success with a + * null-terminated list of realms in *realms_out, KRB5_PLUGIN_NO_HANDLE to + * defer to later modules, or another error to terminate processing. + */ +typedef krb5_error_code +(*krb5_hostrealm_host_realm_fn)(krb5_context context, + krb5_hostrealm_moddata data, + const char *host, char ***realms_out); + +/* + * Optional: Determine the possible realms of a hostname, using heuristic or + * less secure mechanisms (ones which should be used after trying referrals + * when getting a service ticket). Return success with a null-terminated list + * of realms in *realms_out, KRB5_PLUGIN_NO_HANDLE to defer to later modules, + * or another error to terminate processing. + */ +typedef krb5_error_code +(*krb5_hostrealm_fallback_realm_fn)(krb5_context context, + krb5_hostrealm_moddata data, + const char *host, char ***realms_out); + +/* + * Optional: Determine the possible default realms of the local host. Return + * success with a null-terminated list of realms in *realms_out, + * KRB5_PLUGIN_NO_HANDLE to defer to later modules, or another error to + * terminate processing. + */ +typedef krb5_error_code +(*krb5_hostrealm_default_realm_fn)(krb5_context context, + krb5_hostrealm_moddata data, + char ***realms_out); + +/* + * Mandatory (if any of the query methods are implemented): Release the memory + * returned by one of the interface methods. + */ +typedef void +(*krb5_hostrealm_free_list_fn)(krb5_context context, + krb5_hostrealm_moddata data, char **list); + +/* Optional: Release resources used by module data. */ +typedef void +(*krb5_hostrealm_fini_fn)(krb5_context context, krb5_hostrealm_moddata data); + +/* hostrealm vtable for major version 1. */ +typedef struct krb5_hostrealm_vtable_st { + const char *name; /* Mandatory: name of module. */ + krb5_hostrealm_init_fn init; + krb5_hostrealm_fini_fn fini; + krb5_hostrealm_host_realm_fn host_realm; + krb5_hostrealm_fallback_realm_fn fallback_realm; + krb5_hostrealm_default_realm_fn default_realm; + krb5_hostrealm_free_list_fn free_list; + /* Minor version 1 ends here. */ +} *krb5_hostrealm_vtable; + +#endif /* KRB5_HOSTREALM_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_auth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_auth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..3f9392362da01642905d2b5b258138eb9f2200e8 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_auth_plugin.h @@ -0,0 +1,315 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2017 by the Massachusetts Institute of Technology. + * 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. + */ + +/* + * Declarations for kadm5_auth plugin module implementors. + * + * The kadm5_auth pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 2. + * + * kadm5_auth plugin modules should define a function named + * kadm5_auth__initvt, matching the signature: + * + * krb5_error_code + * kadm5_auth_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_kadm5_auth_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_KADM5_AUTH_PLUGIN_H +#define KRB5_KADM5_AUTH_PLUGIN_H + +#include +#include + +/* An abstract type for kadm5_auth module data. */ +typedef struct kadm5_auth_moddata_st *kadm5_auth_moddata; + +/* + * A module can optionally include to inspect principal or + * policy records from requests that add or modify principals or policies. + * Note that fields of principal and policy structures are only valid if the + * corresponding bit is set in the accompanying mask parameter. + */ +struct _kadm5_principal_ent_t; +struct _kadm5_policy_ent_t; + +/* + * A module can optionally generate restrictions when checking permissions for + * adding or modifying a principal entry. Restriction fields will only be + * honored if the corresponding mask bit is set. The operable mask bits are + * defined in and are: + * + * - KADM5_ATTRIBUTES for require_attrs, forbid_attrs + * - KADM5_POLICY for policy + * - KADM5_POLICY_CLR to require that policy be unset + * - KADM5_PRINC_EXPIRE_TIME for princ_lifetime + * - KADM5_PW_EXPIRATION for pw_lifetime + * - KADM5_MAX_LIFE for max_life + * - KADM5_MAX_RLIFE for max_renewable_life + */ +struct kadm5_auth_restrictions { + long mask; + krb5_flags require_attrs; + krb5_flags forbid_attrs; + krb5_deltat princ_lifetime; + krb5_deltat pw_lifetime; + krb5_deltat max_life; + krb5_deltat max_renewable_life; + char *policy; +}; + +/*** Method type declarations ***/ + +/* + * Optional: Initialize module data. acl_file is the realm's configured ACL + * file, or NULL if none was configured. Return 0 on success, + * KRB5_PLUGIN_NO_HANDLE if the module is inoperable (due to configuration, for + * example), and any other error code to abort kadmind startup. Optionally set + * *data_out to a module data object to be passed to future calls. + */ +typedef krb5_error_code +(*kadm5_auth_init_fn)(krb5_context context, const char *acl_file, + kadm5_auth_moddata *data_out); + +/* Optional: Release resources used by module data. */ +typedef void +(*kadm5_auth_fini_fn)(krb5_context context, kadm5_auth_moddata data); + +/* + * Each check method below should return 0 to explicitly authorize the request, + * KRB5_PLUGIN_NO_HANDLE to neither authorize nor deny the request, and any + * other error code (such as EPERM) to explicitly deny the request. If a check + * method is not defined, the module will neither authorize nor deny the + * request. A request succeeds if at least one kadm5_auth module explicitly + * authorizes the request and none of the modules explicitly deny it. + */ + +/* Optional: authorize an add-principal operation, and optionally generate + * restrictions. */ +typedef krb5_error_code +(*kadm5_auth_addprinc_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target, + const struct _kadm5_principal_ent_t *ent, long mask, + struct kadm5_auth_restrictions **rs_out); + +/* Optional: authorize a modify-principal operation, and optionally generate + * restrictions. */ +typedef krb5_error_code +(*kadm5_auth_modprinc_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target, + const struct _kadm5_principal_ent_t *ent, long mask, + struct kadm5_auth_restrictions **rs_out); + +/* Optional: authorize a set-string operation. */ +typedef krb5_error_code +(*kadm5_auth_setstr_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target, + const char *key, const char *value); + +/* Optional: authorize a change-password operation. */ +typedef krb5_error_code +(*kadm5_auth_cpw_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, krb5_const_principal target); + +/* Optional: authorize a randomize-keys operation. */ +typedef krb5_error_code +(*kadm5_auth_chrand_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a set-key operation. */ +typedef krb5_error_code +(*kadm5_auth_setkey_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a purgekeys operation. */ +typedef krb5_error_code +(*kadm5_auth_purgekeys_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a delete-principal operation. */ +typedef krb5_error_code +(*kadm5_auth_delprinc_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a rename-principal operation. */ +typedef krb5_error_code +(*kadm5_auth_renprinc_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal src, + krb5_const_principal dest); + +/* Optional: authorize a get-principal operation. */ +typedef krb5_error_code +(*kadm5_auth_getprinc_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a get-strings operation. */ +typedef krb5_error_code +(*kadm5_auth_getstrs_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize an extract-keys operation. */ +typedef krb5_error_code +(*kadm5_auth_extract_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal target); + +/* Optional: authorize a list-principals operation. */ +typedef krb5_error_code +(*kadm5_auth_listprincs_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client); + +/* Optional: authorize an add-policy operation. */ +typedef krb5_error_code +(*kadm5_auth_addpol_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, const char *policy, + const struct _kadm5_policy_ent_t *ent, long mask); + +/* Optional: authorize a modify-policy operation. */ +typedef krb5_error_code +(*kadm5_auth_modpol_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, const char *policy, + const struct _kadm5_policy_ent_t *ent, long mask); + +/* Optional: authorize a delete-policy operation. */ +typedef krb5_error_code +(*kadm5_auth_delpol_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, const char *policy); + +/* Optional: authorize a get-policy operation. client_policy is the client + * principal's policy name, or NULL if it does not have one. */ +typedef krb5_error_code +(*kadm5_auth_getpol_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, const char *policy, + const char *client_policy); + +/* Optional: authorize a list-policies operation. */ +typedef krb5_error_code +(*kadm5_auth_listpols_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client); + +/* Optional: authorize an iprop operation. */ +typedef krb5_error_code +(*kadm5_auth_iprop_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client); + +/* Optional: authorize an add-alias operation. */ +typedef krb5_error_code +(*kadm5_auth_addalias_fn)(krb5_context context, kadm5_auth_moddata data, + krb5_const_principal client, + krb5_const_principal alias_princ, + krb5_const_principal target_princ); + +/* + * Optional: receive a notification that the most recent authorized operation + * has ended. If a kadm5_auth module is also a KDB module, it can assume that + * all KDB methods invoked between a kadm5_auth authorization method invocation + * and a kadm5_auth end invocation are performed as part of the authorized + * operation. + * + * The end method may be invoked without a preceding authorization method in + * some cases; the module must be prepared to ignore such calls. + */ +typedef void +(*kadm5_auth_end_fn)(krb5_context context, kadm5_auth_moddata data); + +/* + * Optional: free a restrictions object. This method does not need to be + * defined if the module does not generate restrictions objects, or if it + * returns aliases to restrictions objects contained from within the module + * data. + */ +typedef void +(*kadm5_auth_free_restrictions_fn)(krb5_context context, + kadm5_auth_moddata data, + struct kadm5_auth_restrictions *rs); + +/* kadm5_auth vtable for major version 1. */ +typedef struct kadm5_auth_vtable_st { + const char *name; /* Mandatory: name of module. */ + kadm5_auth_init_fn init; + kadm5_auth_fini_fn fini; + + kadm5_auth_addprinc_fn addprinc; + kadm5_auth_modprinc_fn modprinc; + kadm5_auth_setstr_fn setstr; + kadm5_auth_cpw_fn cpw; + kadm5_auth_chrand_fn chrand; + kadm5_auth_setkey_fn setkey; + kadm5_auth_purgekeys_fn purgekeys; + kadm5_auth_delprinc_fn delprinc; + kadm5_auth_renprinc_fn renprinc; + + kadm5_auth_getprinc_fn getprinc; + kadm5_auth_getstrs_fn getstrs; + kadm5_auth_extract_fn extract; + kadm5_auth_listprincs_fn listprincs; + + kadm5_auth_addpol_fn addpol; + kadm5_auth_modpol_fn modpol; + kadm5_auth_delpol_fn delpol; + kadm5_auth_getpol_fn getpol; + kadm5_auth_listpols_fn listpols; + + kadm5_auth_iprop_fn iprop; + + kadm5_auth_end_fn end; + + kadm5_auth_free_restrictions_fn free_restrictions; + /* Minor version 1 ends here. */ + kadm5_auth_addalias_fn addalias; + /* Minor version 2 ends here. */ +} *kadm5_auth_vtable; + +#endif /* KRB5_KADM5_AUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_hook_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_hook_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..cca6d63503dbfc79b4c9ad2ad77b3afb7172b750 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kadm5_hook_plugin.h @@ -0,0 +1,160 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2010 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef H_KRB5_KADM5_HOOK_PLUGIN +#define H_KRB5_KADM5_HOOK_PLUGIN + +/** + * @file krb5/krb5_kadm5_hook_plugin.h + * Provide a plugin interface for kadm5 operations. This interface + * permits a plugin to intercept principal modification, creation and + * change password operations. Operations run at two stages: a + * precommit stage that runs before the operation is committed to the + * database and a postcommit operation that runs after the database + * is updated; see #kadm5_hook_stage for details on semantics. + * + * This interface is based on a proposed extension to Heimdal by Russ + * Allbery; it is likely that Heimdal will adopt an approach based on + * stacked kdb modules rather than this interface. For MIT, writing a + * plugin to this interface is significantly easier than stacking kdb + * modules. Also, the kadm5 interface is significantly more stable + * than the kdb interface, so this approach is more desirable than + * stacked kdb modules. + * + * This interface depends on kadm5/admin.h. As such, the interface + * does not provide strong guarantees of ABI stability. + * + * The kadm5_hook interface currently has only one supported major version, + * which is 1. Major version 1 has a current minor version number of 3. + * + * kadm5_hook plugins should: + * kadm5_hook__initvt, matching the signature: + * + * krb5_error_code + * kadm5_hook_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to kadm5_hook_vftable_1 + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#include +#include +#include + +/** + * Whether the operation is being run before or after the database + * update. + */ +enum kadm5_hook_stage { + /** In this stage, any plugin failure prevents following plugins from + * running and aborts the operation.*/ + KADM5_HOOK_STAGE_PRECOMMIT, + /** In this stage, plugin failures are logged but otherwise ignored.*/ + KADM5_HOOK_STAGE_POSTCOMMIT +}; + +/** Opaque module data pointer. */ +typedef struct kadm5_hook_modinfo_st kadm5_hook_modinfo; + +/** + * Interface for the v1 virtual table for the kadm5_hook plugin. + * All entry points are optional. The name field must be provided. + */ +typedef struct kadm5_hook_vtable_1_st { + + /** A text string identifying the plugin for logging messages. */ + const char *name; + + /** Initialize a plugin module. + * @param modinfo returns newly allocated module info for future + * calls. Cleaned up by the fini() function. + */ + kadm5_ret_t (*init)(krb5_context, kadm5_hook_modinfo **modinfo); + + /** Clean up a module and free @a modinfo. */ + void (*fini)(krb5_context, kadm5_hook_modinfo *modinfo); + + /** Indicates that the password is being changed. + * @param stage is an integer from #kadm5_hook_stage enumeration + * @param keepold is true if existing keys are being kept. + * @param newpass is NULL if the key sare being randomized. + */ + kadm5_ret_t (*chpass)(krb5_context, + kadm5_hook_modinfo *modinfo, + int stage, + krb5_principal, krb5_boolean keepold, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + const char *newpass); + + /** Indicate a principal is created. */ + kadm5_ret_t (*create)(krb5_context, + kadm5_hook_modinfo *, + int stage, + kadm5_principal_ent_t, long mask, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + const char *password); + + /** Modify a principal. */ + kadm5_ret_t (*modify)(krb5_context, + kadm5_hook_modinfo *, + int stage, + kadm5_principal_ent_t, long mask); + + /** Indicate a principal is deleted. */ + kadm5_ret_t (*remove)(krb5_context, + kadm5_hook_modinfo *modinfo, + int stage, krb5_principal); + + /* End of minor version 1. */ + + /** Indicate a principal is renamed. */ + kadm5_ret_t (*rename)(krb5_context, + kadm5_hook_modinfo *modinfo, + int stage, krb5_principal, krb5_principal); + + /* End of minor version 2. */ + + kadm5_ret_t (*alias)(krb5_context context, kadm5_hook_modinfo *modinfo, + int stage, krb5_principal alias, + krb5_principal target); + + /* End of minor version 3. */ + +} kadm5_hook_vftable_1; + +#endif /*H_KRB5_KADM5_HOOK_PLUGIN*/ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpolicy_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpolicy_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..c7592c5dba7833340f1fd604c3dfe00b3b4fd65b --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpolicy_plugin.h @@ -0,0 +1,128 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* include/krb5/kdcpolicy_plugin.h - KDC policy plugin interface */ +/* + * Copyright (C) 2017 by Red Hat, 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. + * + * 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. + */ + +/* + * Declarations for kdcpolicy plugin module implementors. + * + * The kdcpolicy pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 1. + * + * kdcpolicy plugin modules should define a function named + * kdcpolicy__initvt, matching the signature: + * + * krb5_error_code + * kdcpolicy_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_kdcpolicy_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_POLICY_PLUGIN_H +#define KRB5_POLICY_PLUGIN_H + +#include + +/* Abstract module datatype. */ +typedef struct krb5_kdcpolicy_moddata_st *krb5_kdcpolicy_moddata; + +/* A module can optionally include kdb.h to inspect principal entries when + * authorizing requests. */ +struct _krb5_db_entry_new; + +/* + * Optional: Initialize module data. Return 0 on success, + * KRB5_PLUGIN_NO_HANDLE if the module is inoperable (due to configuration, for + * example), and any other error code to abort KDC startup. Optionally set + * *data_out to a module data object to be passed to future calls. + */ +typedef krb5_error_code +(*krb5_kdcpolicy_init_fn)(krb5_context context, + krb5_kdcpolicy_moddata *data_out); + +/* Optional: Clean up module data. */ +typedef krb5_error_code +(*krb5_kdcpolicy_fini_fn)(krb5_context context, + krb5_kdcpolicy_moddata moddata); + +/* + * Optional: return an error code and set status to an appropriate string + * literal to deny an AS request; otherwise return 0. lifetime_out, if set, + * restricts the ticket lifetime. renew_lifetime_out, if set, restricts the + * ticket renewable lifetime. + */ +typedef krb5_error_code +(*krb5_kdcpolicy_check_as_fn)(krb5_context context, + krb5_kdcpolicy_moddata moddata, + const krb5_kdc_req *request, + const struct _krb5_db_entry_new *client, + const struct _krb5_db_entry_new *server, + const char *const *auth_indicators, + const char **status, krb5_deltat *lifetime_out, + krb5_deltat *renew_lifetime_out); + +/* + * Optional: return an error code and set status to an appropriate string + * literal to deny a TGS request; otherwise return 0. lifetime_out, if set, + * restricts the ticket lifetime. renew_lifetime_out, if set, restricts the + * ticket renewable lifetime. + */ +typedef krb5_error_code +(*krb5_kdcpolicy_check_tgs_fn)(krb5_context context, + krb5_kdcpolicy_moddata moddata, + const krb5_kdc_req *request, + const struct _krb5_db_entry_new *server, + const krb5_ticket *ticket, + const char *const *auth_indicators, + const char **status, krb5_deltat *lifetime_out, + krb5_deltat *renew_lifetime_out); + +typedef struct krb5_kdcpolicy_vtable_st { + const char *name; + krb5_kdcpolicy_init_fn init; + krb5_kdcpolicy_fini_fn fini; + krb5_kdcpolicy_check_as_fn check_as; + krb5_kdcpolicy_check_tgs_fn check_tgs; +} *krb5_kdcpolicy_vtable; + +#endif /* KRB5_POLICY_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpreauth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpreauth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..f40e368cc1d1a3988f2c5f9c620e9e5b185e557f --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/kdcpreauth_plugin.h @@ -0,0 +1,417 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (c) 2006 Red Hat, Inc. + * Portions copyright (c) 2006, 2011 Massachusetts Institute of Technology + * 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 of Red Hat, Inc., 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 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. + */ + +/* + * Declarations for kdcpreauth plugin module implementors. + * + * The kdcpreauth interface has a single supported major version, which is 1. + * Major version 1 has a current minor version of 2. kdcpreauth modules should + * define a function named kdcpreauth__initvt, matching the + * signature: + * + * krb5_error_code + * kdcpreauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for the interface and maj_ver: + * kdcpreauth, maj_ver == 1: Cast to krb5_kdcpreauth_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_KDCPREAUTH_PLUGIN_H +#define KRB5_KDCPREAUTH_PLUGIN_H + +#include +#include + +/* kdcpreauth mechanism property flags */ + +/* + * Causes the KDC to include this mechanism in a list of supported preauth + * types if the user's DB entry flags the user as requiring hardware-based + * preauthentication. + */ +#define PA_HARDWARE 0x00000004 + +/* + * Causes the KDC to include this mechanism in a list of supported preauth + * types if the user's DB entry flags the user as requiring preauthentication, + * and to fail preauthentication if we can't verify the client data. The + * flipside of PA_SUFFICIENT. + */ +#define PA_REQUIRED 0x00000008 + +/* + * Causes the KDC to include this mechanism in a list of supported preauth + * types if the user's DB entry flags the user as requiring preauthentication, + * and to mark preauthentication as successful if we can verify the client + * data. The flipside of PA_REQUIRED. + */ +#define PA_SUFFICIENT 0x00000010 + +/* + * Marks this preauthentication mechanism as one which changes the key which is + * used for encrypting the response to the client. Modules which have this + * flag have their server_return_fn called before modules which do not, and are + * passed over if a previously-called module has modified the encrypting key. + */ +#define PA_REPLACES_KEY 0x00000020 + +/* + * Not really a padata type, so don't include it in any list of preauth types + * which gets sent over the wire. + */ +#define PA_PSEUDO 0x00000080 + +/* + * Indicates that e_data in non-FAST errors should be encoded as typed data + * instead of padata. + */ +#define PA_TYPED_E_DATA 0x00000100 + +/* Abstract type for a KDC callback data handle. */ +typedef struct krb5_kdcpreauth_rock_st *krb5_kdcpreauth_rock; + +/* Abstract type for module data and per-request module data. */ +typedef struct krb5_kdcpreauth_moddata_st *krb5_kdcpreauth_moddata; +typedef struct krb5_kdcpreauth_modreq_st *krb5_kdcpreauth_modreq; + +/* The verto context structure type (typedef is in verto.h; we want to avoid a + * header dependency for the moment). */ +struct verto_ctx; + +/* Before using a callback after version 1, modules must check the vers + * field of the callback structure. */ +typedef struct krb5_kdcpreauth_callbacks_st { + int vers; + + krb5_deltat (*max_time_skew)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* + * Get an array of krb5_keyblock structures containing the client keys + * matching the request enctypes, terminated by an entry with key type = 0. + * Returns ENOENT if no keys are available for the request enctypes. Free + * the resulting object with the free_keys callback. + */ + krb5_error_code (*client_keys)(krb5_context context, + krb5_kdcpreauth_rock rock, + krb5_keyblock **keys_out); + + /* Free the result of client_keys. */ + void (*free_keys)(krb5_context context, krb5_kdcpreauth_rock rock, + krb5_keyblock *keys); + + /* + * Get the encoded request body, which is sometimes needed for checksums. + * For a FAST request this is the encoded inner request body. The returned + * pointer is an alias and should not be freed. + */ + krb5_data *(*request_body)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* Get a pointer to the FAST armor key, or NULL if the request did not use + * FAST. The returned pointer is an alias and should not be freed. */ + krb5_keyblock *(*fast_armor)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* Retrieve a string attribute from the client DB entry, or NULL if no such + * attribute is set. Free the result with the free_string callback. */ + krb5_error_code (*get_string)(krb5_context context, + krb5_kdcpreauth_rock rock, const char *key, + char **value_out); + + /* Free the result of get_string. */ + void (*free_string)(krb5_context context, krb5_kdcpreauth_rock rock, + char *string); + + /* Get a pointer to the client DB entry (returned as a void pointer to + * avoid a dependency on a libkdb5 type). */ + void *(*client_entry)(krb5_context context, krb5_kdcpreauth_rock rock); + + /* Get a pointer to the verto context which should be used by an + * asynchronous edata or verify method. */ + struct verto_ctx *(*event_context)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* End of version 1 kdcpreauth callbacks. */ + + /* Return true if the client DB entry contains any keys matching the + * request enctypes. */ + krb5_boolean (*have_client_keys)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* End of version 2 kdcpreauth callbacks. */ + + /* + * Get the current reply key. Initially the reply key is the decrypted + * client long-term key chosen according to the request enctype list, or + * NULL if no matching key was found. The value may be changed by the + * replace_reply_key callback or a return_padata method modifying + * encrypting_key. The returned pointer is an alias and should not be + * freed. + */ + const krb5_keyblock *(*client_keyblock)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* Assert an authentication indicator in the AS-REP authdata. Duplicate + * indicators will be ignored. */ + krb5_error_code (*add_auth_indicator)(krb5_context context, + krb5_kdcpreauth_rock rock, + const char *indicator); + + /* + * Read a data value for pa_type from the request cookie, placing it in + * *out. The value placed there is an alias and must not be freed. + * Returns true if a value for pa_type was retrieved, false if not. + */ + krb5_boolean (*get_cookie)(krb5_context context, krb5_kdcpreauth_rock rock, + krb5_preauthtype pa_type, krb5_data *out); + + /* + * Set a data value for pa_type to be sent in a secure cookie in the next + * error response. If pa_type is already present, the value is ignored. + * If the preauth mechanism has different preauth types for requests and + * responses, use the request type. Secure cookies are encrypted in a key + * known only to the KDCs, but can be replayed within a short time window + * for requests using the same client principal. + */ + krb5_error_code (*set_cookie)(krb5_context context, + krb5_kdcpreauth_rock rock, + krb5_preauthtype pa_type, + const krb5_data *data); + + /* End of version 3 kdcpreauth callbacks. */ + + /* + * Return true if princ matches the principal named in the request or the + * client principal (possibly canonicalized). If princ does not match, + * attempt a database lookup of princ with aliases allowed and compare the + * result to the client principal, returning true if it matches. + * Otherwise, return false. + */ + krb5_boolean (*match_client)(krb5_context context, + krb5_kdcpreauth_rock rock, + krb5_principal princ); + + /* + * Get an alias to the client DB entry principal (possibly canonicalized). + */ + krb5_principal (*client_name)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* End of version 4 kdcpreauth callbacks. */ + + /* + * Instruct the KDC to send a freshness token in the method data + * accompanying a PREAUTH_REQUIRED or PREAUTH_FAILED error, if the client + * indicated support for freshness tokens. This callback should only be + * invoked from the edata method. + */ + void (*send_freshness_token)(krb5_context context, + krb5_kdcpreauth_rock rock); + + /* Validate a freshness token sent by the client. Return 0 on success, + * KRB5KDC_ERR_PREAUTH_EXPIRED on error. */ + krb5_error_code (*check_freshness_token)(krb5_context context, + krb5_kdcpreauth_rock rock, + const krb5_data *token); + + /* End of version 5 kdcpreauth callbacks. */ + + /* + * Replace the reply key with key. If is_strengthen is true, key must be a + * derivative of the client long-term key. This callback may be invoked + * from the verify or return_padata methods. If it is invoked from the + * verify method, the new key will appear as the encrypting_key input to + * return_padata. + */ + krb5_error_code (*replace_reply_key)(krb5_context context, + krb5_kdcpreauth_rock rock, + const krb5_keyblock *key, + krb5_boolean is_strengthen); + + /* End of version 6 kdcpreauth callbacks. */ + +} *krb5_kdcpreauth_callbacks; + +/* Optional: preauth plugin initialization function. */ +typedef krb5_error_code +(*krb5_kdcpreauth_init_fn)(krb5_context context, + krb5_kdcpreauth_moddata *moddata_out, + const char **realmnames); + +/* Optional: preauth plugin cleanup function. */ +typedef void +(*krb5_kdcpreauth_fini_fn)(krb5_context context, + krb5_kdcpreauth_moddata moddata); + +/* + * Optional: return the flags which the KDC should use for this module. This + * is a callback instead of a static value because the module may or may not + * wish to count itself as a hardware preauthentication module (in other words, + * the flags may be affected by the configuration, for example if a site + * administrator can force a particular preauthentication type to be supported + * using only hardware). This function is called for each entry entry in the + * server_pa_type_list. + */ +typedef int +(*krb5_kdcpreauth_flags_fn)(krb5_context context, krb5_preauthtype pa_type); + +/* + * Responder for krb5_kdcpreauth_edata_fn. If invoked with a non-zero code, pa + * will be ignored and the padata type will not be included in the hint list. + * If invoked with a zero code and a null pa value, the padata type will be + * included in the list with an empty value. If invoked with a zero code and a + * non-null pa value, pa will be included in the hint list and will later be + * freed by the KDC. + */ +typedef void +(*krb5_kdcpreauth_edata_respond_fn)(void *arg, krb5_error_code code, + krb5_pa_data *pa); + +/* + * Optional: provide pa_data to send to the client as part of the "you need to + * use preauthentication" error. The implementation must invoke the respond + * when complete, whether successful or not, either before returning or + * asynchronously using the verto context returned by cb->event_context(). + * + * This function is not allowed to create a modreq object because we have no + * guarantee that the client will ever make a follow-up request, or that it + * will hit this KDC if it does. + */ +typedef void +(*krb5_kdcpreauth_edata_fn)(krb5_context context, krb5_kdc_req *request, + krb5_kdcpreauth_callbacks cb, + krb5_kdcpreauth_rock rock, + krb5_kdcpreauth_moddata moddata, + krb5_preauthtype pa_type, + krb5_kdcpreauth_edata_respond_fn respond, + void *arg); + +/* + * Responder for krb5_kdcpreauth_verify_fn. Invoke with the arg parameter + * supplied to verify, the error code (0 for success), an optional module + * request state object to be consumed by return_fn or free_modreq_fn, optional + * e_data to be passed to the caller if code is nonzero, and optional + * authorization data to be included in the ticket. In non-FAST replies, + * e_data will be encoded as typed-data if the module sets the PA_TYPED_E_DATA + * flag, and as pa-data otherwise. e_data and authz_data will be freed by the + * KDC. + */ +typedef void +(*krb5_kdcpreauth_verify_respond_fn)(void *arg, krb5_error_code code, + krb5_kdcpreauth_modreq modreq, + krb5_pa_data **e_data, + krb5_authdata **authz_data); + +/* + * Optional: verify preauthentication data sent by the client, setting the + * TKT_FLG_PRE_AUTH or TKT_FLG_HW_AUTH flag in the enc_tkt_reply's "flags" + * field as appropriate. The implementation must invoke the respond function + * when complete, whether successful or not, either before returning or + * asynchronously using the verto context returned by cb->event_context(). + */ +typedef void +(*krb5_kdcpreauth_verify_fn)(krb5_context context, + krb5_data *req_pkt, krb5_kdc_req *request, + krb5_enc_tkt_part *enc_tkt_reply, + krb5_pa_data *data, + krb5_kdcpreauth_callbacks cb, + krb5_kdcpreauth_rock rock, + krb5_kdcpreauth_moddata moddata, + krb5_kdcpreauth_verify_respond_fn respond, + void *arg); + +/* + * Optional: generate preauthentication response data to send to the client as + * part of the AS-REP. If it needs to override the key which is used to + * encrypt the response, it can do so by modifying encrypting_key, but it is + * preferrable to use the replace_reply_key callback. + */ +typedef krb5_error_code +(*krb5_kdcpreauth_return_fn)(krb5_context context, + krb5_pa_data *padata, + krb5_data *req_pkt, + krb5_kdc_req *request, + krb5_kdc_rep *reply, + krb5_keyblock *encrypting_key, + krb5_pa_data **send_pa_out, + krb5_kdcpreauth_callbacks cb, + krb5_kdcpreauth_rock rock, + krb5_kdcpreauth_moddata moddata, + krb5_kdcpreauth_modreq modreq); + +/* Optional: free a per-request context. */ +typedef void +(*krb5_kdcpreauth_free_modreq_fn)(krb5_context, + krb5_kdcpreauth_moddata moddata, + krb5_kdcpreauth_modreq modreq); + +/* Optional: invoked after init_fn to provide the module with a pointer to the + * verto main loop. */ +typedef krb5_error_code +(*krb5_kdcpreauth_loop_fn)(krb5_context context, + krb5_kdcpreauth_moddata moddata, + struct verto_ctx *ctx); + +typedef struct krb5_kdcpreauth_vtable_st { + /* Mandatory: name of module. */ + const char *name; + + /* Mandatory: pointer to zero-terminated list of pa_types which this module + * can provide services for. */ + krb5_preauthtype *pa_type_list; + + krb5_kdcpreauth_init_fn init; + krb5_kdcpreauth_fini_fn fini; + krb5_kdcpreauth_flags_fn flags; + krb5_kdcpreauth_edata_fn edata; + krb5_kdcpreauth_verify_fn verify; + krb5_kdcpreauth_return_fn return_padata; + krb5_kdcpreauth_free_modreq_fn free_modreq; + /* Minor 1 ends here. */ + + krb5_kdcpreauth_loop_fn loop; + /* Minor 2 ends here. */ +} *krb5_kdcpreauth_vtable; + +#endif /* KRB5_KDCPREAUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/krb5.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/krb5.h new file mode 100644 index 0000000000000000000000000000000000000000..d1c72c125b27913a18d958478205d414a7da8ac3 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/krb5.h @@ -0,0 +1,9164 @@ +/* This file is generated, please don't edit it directly. */ +#ifndef KRB5_KRB5_H_INCLUDED +#define KRB5_KRB5_H_INCLUDED +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* General definitions for Kerberos version 5. */ +/* + * Copyright 1989, 1990, 1995, 2001, 2003, 2007, 2011 by the Massachusetts + * Institute of Technology. All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef KRB5_GENERAL__ +#define KRB5_GENERAL__ + + /* By default, do not expose deprecated interfaces. */ +#ifndef KRB5_DEPRECATED +#define KRB5_DEPRECATED 0 +#endif + +#if defined(__MACH__) && defined(__APPLE__) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#if defined(_MSDOS) || defined(_WIN32) +#include +#endif + +#ifndef KRB5_CONFIG__ +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif /* !KRB5_CALLCONV */ +#endif /* !KRB5_CONFIG__ */ + +#ifndef KRB5_CALLCONV_WRONG +#define KRB5_CALLCONV_WRONG +#endif + +#ifndef THREEPARAMOPEN +#define THREEPARAMOPEN(x,y,z) open(x,y,z) +#endif + +#define KRB5_OLD_CRYPTO + +#include +#include /* for *_MAX */ +#include +#include + +#ifndef KRB5INT_BEGIN_DECLS +#if defined(__cplusplus) +#define KRB5INT_BEGIN_DECLS extern "C" { +#define KRB5INT_END_DECLS } +#else +#define KRB5INT_BEGIN_DECLS +#define KRB5INT_END_DECLS +#endif +#endif + +KRB5INT_BEGIN_DECLS + +#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__)) +#pragma pack(push,2) +#endif + +#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 30203 +# define KRB5_ATTR_DEPRECATED __attribute__((deprecated)) +#elif defined _WIN32 +# define KRB5_ATTR_DEPRECATED __declspec(deprecated) +#else +# define KRB5_ATTR_DEPRECATED +#endif + +/* from profile.h */ +struct _profile_t; +/* typedef struct _profile_t *profile_t; */ + +/* + * begin wordsize.h + */ + +/* + * Word-size related definition. + */ + +typedef uint8_t krb5_octet; +typedef int16_t krb5_int16; +typedef uint16_t krb5_ui_2; +typedef int32_t krb5_int32; +typedef uint32_t krb5_ui_4; + +#define VALID_INT_BITS INT_MAX +#define VALID_UINT_BITS UINT_MAX + +#define KRB5_INT32_MAX 2147483647 +/* this strange form is necessary since - is a unary operator, not a sign + indicator */ +#define KRB5_INT32_MIN (-KRB5_INT32_MAX-1) + +#define KRB5_INT16_MAX 65535 +/* this strange form is necessary since - is a unary operator, not a sign + indicator */ +#define KRB5_INT16_MIN (-KRB5_INT16_MAX-1) + +/* + * end wordsize.h + */ + +/* + * begin "base-defs.h" + */ + +/* + * Basic definitions for Kerberos V5 library + */ + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +typedef unsigned int krb5_boolean; +typedef unsigned int krb5_msgtype; +typedef unsigned int krb5_kvno; + +typedef krb5_int32 krb5_addrtype; +typedef krb5_int32 krb5_enctype; +typedef krb5_int32 krb5_cksumtype; +typedef krb5_int32 krb5_authdatatype; +typedef krb5_int32 krb5_keyusage; +typedef krb5_int32 krb5_cryptotype; + +typedef krb5_int32 krb5_preauthtype; /* This may change, later on */ +typedef krb5_int32 krb5_flags; + +/** + * Represents a timestamp in seconds since the POSIX epoch. This legacy type + * is used frequently in the ABI, but cannot represent timestamps after 2038 as + * a positive number. Code which uses this type should cast values of it to + * uint32_t so that negative values are treated as timestamps between 2038 and + * 2106 on platforms with 64-bit time_t. + */ +typedef krb5_int32 krb5_timestamp; + +typedef krb5_int32 krb5_deltat; + +/** + * Used to convey an operation status. The value 0 indicates success; any + * other values are com_err codes. Use krb5_get_error_message() to obtain a + * string describing the error. + */ +typedef krb5_int32 krb5_error_code; + +typedef krb5_error_code krb5_magic; + +typedef struct _krb5_data { + krb5_magic magic; + unsigned int length; + char *data; +} krb5_data; + +/* Originally introduced for PKINIT; now unused. Do not use this. */ +typedef struct _krb5_octet_data { + krb5_magic magic; + unsigned int length; + krb5_octet *data; +} krb5_octet_data; + +/* Originally used to recognize AFS and default salts. No longer used. */ +#define SALT_TYPE_AFS_LENGTH UINT_MAX +#define SALT_TYPE_NO_LENGTH UINT_MAX + +typedef void * krb5_pointer; +typedef void const * krb5_const_pointer; + +typedef struct krb5_principal_data { + krb5_magic magic; + krb5_data realm; + krb5_data *data; /**< An array of strings */ + krb5_int32 length; + krb5_int32 type; +} krb5_principal_data; + +typedef krb5_principal_data * krb5_principal; + +/* + * Per V5 spec on definition of principal types + */ + +#define KRB5_NT_UNKNOWN 0 /**< Name type not known */ +#define KRB5_NT_PRINCIPAL 1 /**< Just the name of the principal + as in DCE, or for users */ +#define KRB5_NT_SRV_INST 2 /**< Service and other unique instance (krbtgt) */ +#define KRB5_NT_SRV_HST 3 /**< Service with host name as instance + (telnet, rcommands) */ +#define KRB5_NT_SRV_XHST 4 /**< Service with host as remaining components */ +#define KRB5_NT_UID 5 /**< Unique ID */ +#define KRB5_NT_X500_PRINCIPAL 6 /**< PKINIT */ +#define KRB5_NT_SMTP_NAME 7 /**< Name in form of SMTP email name */ +#define KRB5_NT_ENTERPRISE_PRINCIPAL 10 /**< Windows 2000 UPN */ +#define KRB5_NT_WELLKNOWN 11 /**< Well-known (special) principal */ +#define KRB5_WELLKNOWN_NAMESTR "WELLKNOWN" /**< First component of + NT_WELLKNOWN principals */ +#define KRB5_NT_MS_PRINCIPAL -128 /**< Windows 2000 UPN and SID */ +#define KRB5_NT_MS_PRINCIPAL_AND_ID -129 /**< NT 4 style name */ +#define KRB5_NT_ENT_PRINCIPAL_AND_ID -130 /**< NT 4 style name and SID */ + +/** Constant version of krb5_principal_data. */ +typedef const krb5_principal_data *krb5_const_principal; + +#define krb5_princ_realm(context, princ) (&(princ)->realm) +#define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value)) +#define krb5_princ_set_realm_length(context, princ,value) (princ)->realm.length = (value) +#define krb5_princ_set_realm_data(context, princ,value) (princ)->realm.data = (value) +#define krb5_princ_size(context, princ) (princ)->length +#define krb5_princ_type(context, princ) (princ)->type +#define krb5_princ_name(context, princ) (princ)->data +#define krb5_princ_component(context, princ,i) \ + (((i) < krb5_princ_size(context, princ)) \ + ? (princ)->data + (i) \ + : NULL) + +/** Constant for realm referrals. */ +#define KRB5_REFERRAL_REALM "" + +/* + * Referral-specific functions. + */ + +/** + * Check for a match with KRB5_REFERRAL_REALM. + * + * @param [in] r Realm to check + * + * @return @c TRUE if @a r is zero-length, @c FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_is_referral_realm(const krb5_data *r); + +/** + * Return an anonymous realm data. + * + * This function returns constant storage that must not be freed. + * + * @sa #KRB5_ANONYMOUS_REALMSTR + */ +const krb5_data *KRB5_CALLCONV +krb5_anonymous_realm(void); + +/** + * Build an anonymous principal. + * + * This function returns constant storage that must not be freed. + * + * @sa #KRB5_ANONYMOUS_PRINCSTR + */ +krb5_const_principal KRB5_CALLCONV +krb5_anonymous_principal(void); + +#define KRB5_ANONYMOUS_REALMSTR "WELLKNOWN:ANONYMOUS" /**< Anonymous realm */ +#define KRB5_ANONYMOUS_PRINCSTR "ANONYMOUS" /**< Anonymous principal name */ +/* + * end "base-defs.h" + */ + +/* + * begin "hostaddr.h" + */ + +/** Structure for address */ +typedef struct _krb5_address { + krb5_magic magic; + krb5_addrtype addrtype; + unsigned int length; + krb5_octet *contents; +} krb5_address; + +/* per Kerberos v5 protocol spec */ +#define ADDRTYPE_INET 0x0002 +#define ADDRTYPE_DIRECTIONAL 0x0003 +#define ADDRTYPE_CHAOS 0x0005 +#define ADDRTYPE_XNS 0x0006 +#define ADDRTYPE_ISO 0x0007 +#define ADDRTYPE_DDP 0x0010 +#define ADDRTYPE_NETBIOS 0x0014 +#define ADDRTYPE_INET6 0x0018 +/* not yet in the spec... */ +#define ADDRTYPE_ADDRPORT 0x0100 +#define ADDRTYPE_IPPORT 0x0101 + +/* + * Negative values for the host address type are reserved for local use. Do + * not use these types in Kerberos protocol elements. + */ + +/* The contents field contains a UNIX domain socket path. */ +#define ADDRTYPE_UNIXSOCK (0x8000 | 0x0001) + +/* macros to determine if a type is a local type */ +#define ADDRTYPE_IS_LOCAL(addrtype) (addrtype & 0x8000) + +/* + * end "hostaddr.h" + */ + + +struct _krb5_context; +typedef struct _krb5_context * krb5_context; + +struct _krb5_auth_context; +typedef struct _krb5_auth_context * krb5_auth_context; + +struct _krb5_cryptosystem_entry; + +/* + * begin "encryption.h" + */ + +/** Exposed contents of a key. */ +typedef struct _krb5_keyblock { + krb5_magic magic; + krb5_enctype enctype; + unsigned int length; + krb5_octet *contents; +} krb5_keyblock; + +struct krb5_key_st; +/** + * Opaque identifier for a key. + * + * Use with the krb5_k APIs for better performance for repeated operations with + * the same key and usage. Key identifiers must not be used simultaneously + * within multiple threads, as they may contain mutable internal state and are + * not mutex-protected. + */ +typedef struct krb5_key_st *krb5_key; + +#ifdef KRB5_OLD_CRYPTO +typedef struct _krb5_encrypt_block { + krb5_magic magic; + krb5_enctype crypto_entry; /* to call krb5_encrypt_size, you need + this. it was a pointer, but it + doesn't have to be. gross. */ + krb5_keyblock *key; +} krb5_encrypt_block; +#endif + +typedef struct _krb5_checksum { + krb5_magic magic; + krb5_cksumtype checksum_type; /* checksum type */ + unsigned int length; + krb5_octet *contents; +} krb5_checksum; + +typedef struct _krb5_enc_data { + krb5_magic magic; + krb5_enctype enctype; + krb5_kvno kvno; + krb5_data ciphertext; +} krb5_enc_data; + +/** + * Structure to describe a region of text to be encrypted or decrypted. + * + * The @a flags member describes the type of the iov. + * The @a data member points to the memory that will be manipulated. + * All iov APIs take a pointer to the first element of an array of krb5_crypto_iov's + * along with the size of that array. Buffer contents are manipulated in-place; + * data is overwritten. Callers must allocate the right number of krb5_crypto_iov + * structures before calling into an iov API. + */ +typedef struct _krb5_crypto_iov { + krb5_cryptotype flags; /**< iov type (see KRB5_CRYPTO_TYPE macros) */ + krb5_data data; +} krb5_crypto_iov; + +/* per Kerberos v5 protocol spec */ +#define ENCTYPE_NULL 0x0000 +#define ENCTYPE_DES_CBC_CRC 0x0001 /**< @deprecated no longer supported */ +#define ENCTYPE_DES_CBC_MD4 0x0002 /**< @deprecated no longer supported */ +#define ENCTYPE_DES_CBC_MD5 0x0003 /**< @deprecated no longer supported */ +#define ENCTYPE_DES_CBC_RAW 0x0004 /**< @deprecated no longer supported */ +#define ENCTYPE_DES3_CBC_SHA 0x0005 /**< @deprecated DES-3 cbc with SHA1 */ +#define ENCTYPE_DES3_CBC_RAW 0x0006 /**< @deprecated DES-3 cbc mode raw */ +#define ENCTYPE_DES_HMAC_SHA1 0x0008 /**< @deprecated no longer supported */ +/* PKINIT */ +#define ENCTYPE_DSA_SHA1_CMS 0x0009 /**< DSA with SHA1, CMS signature */ +#define ENCTYPE_MD5_RSA_CMS 0x000a /**< MD5 with RSA, CMS signature */ +#define ENCTYPE_SHA1_RSA_CMS 0x000b /**< SHA1 with RSA, CMS signature */ +#define ENCTYPE_RC2_CBC_ENV 0x000c /**< RC2 cbc mode, CMS enveloped data */ +#define ENCTYPE_RSA_ENV 0x000d /**< RSA encryption, CMS enveloped data */ +#define ENCTYPE_RSA_ES_OAEP_ENV 0x000e /**< RSA w/OEAP encryption, CMS enveloped data */ +#define ENCTYPE_DES3_CBC_ENV 0x000f /**< DES-3 cbc mode, CMS enveloped data */ + +#define ENCTYPE_DES3_CBC_SHA1 0x0010 +#define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011 /**< RFC 3962 */ +#define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 /**< RFC 3962 */ +#define ENCTYPE_AES128_CTS_HMAC_SHA256_128 0x0013 /**< RFC 8009 */ +#define ENCTYPE_AES256_CTS_HMAC_SHA384_192 0x0014 /**< RFC 8009 */ +#define ENCTYPE_ARCFOUR_HMAC 0x0017 /**< RFC 4757 */ +#define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018 /**< RFC 4757 */ +#define ENCTYPE_CAMELLIA128_CTS_CMAC 0x0019 /**< RFC 6803 */ +#define ENCTYPE_CAMELLIA256_CTS_CMAC 0x001a /**< RFC 6803 */ +#define ENCTYPE_UNKNOWN 0x01ff + +/* + * Historically we used the value 9 for unkeyed SHA-1. RFC 3961 assigns this + * value to rsa-md5-des3, which fortunately is unused. For ABI compatibility + * we allow either 9 or 14 for SHA-1. + */ +#define CKSUMTYPE_CRC32 0x0001 +#define CKSUMTYPE_RSA_MD4 0x0002 +#define CKSUMTYPE_RSA_MD4_DES 0x0003 +#define CKSUMTYPE_DESCBC 0x0004 +/* des-mac-k */ +/* rsa-md4-des-k */ +#define CKSUMTYPE_RSA_MD5 0x0007 +#define CKSUMTYPE_RSA_MD5_DES 0x0008 +#define CKSUMTYPE_NIST_SHA 0x0009 +#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c +#define CKSUMTYPE_SHA1 0x000e /**< RFC 3961 */ +#define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f /**< RFC 3962. Used with + ENCTYPE_AES128_CTS_HMAC_SHA1_96 */ +#define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 /**< RFC 3962. Used with + ENCTYPE_AES256_CTS_HMAC_SHA1_96 */ +#define CKSUMTYPE_HMAC_SHA256_128_AES128 0x0013 /**< RFC 8009 */ +#define CKSUMTYPE_HMAC_SHA384_192_AES256 0x0014 /**< RFC 8009 */ +#define CKSUMTYPE_CMAC_CAMELLIA128 0x0011 /**< RFC 6803 */ +#define CKSUMTYPE_CMAC_CAMELLIA256 0x0012 /**< RFC 6803 */ +#define CKSUMTYPE_MD5_HMAC_ARCFOUR -137 /* Microsoft netlogon */ +#define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /**< RFC 4757 */ + +/* Constants for the deprecated krb5_c_random_add_entropy() */ +enum { + KRB5_C_RANDSOURCE_OLDAPI = 0, + KRB5_C_RANDSOURCE_OSRAND = 1, + KRB5_C_RANDSOURCE_TRUSTEDPARTY = 2, + KRB5_C_RANDSOURCE_TIMING = 3, + KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL = 4, + KRB5_C_RANDSOURCE_MAX = 5 +}; + +#ifndef krb5_roundup +/* round x up to nearest multiple of y */ +#define krb5_roundup(x, y) ((((x) + (y) - 1)/(y))*(y)) +#endif /* roundup */ + +/* macro function definitions to help clean up code */ + +#if 1 +#define krb5_x(ptr,args) ((ptr)?((*(ptr)) args):(abort(),1)) +#define krb5_xc(ptr,args) ((ptr)?((*(ptr)) args):(abort(),(char*)0)) +#else +#define krb5_x(ptr,args) ((*(ptr)) args) +#define krb5_xc(ptr,args) ((*(ptr)) args) +#endif + +/** + * Encrypt data using a key (operates on keyblock). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] cipher_state Cipher state; specify NULL if not needed + * @param [in] input Data to be encrypted + * @param [out] output Encrypted data + * + * This function encrypts the data block @a input and stores the output into @a + * output. The actual encryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the encryption operation, and + * is updated with the state to be passed as input to the next operation. + * + * @note The caller must initialize @a output and allocate at least enough + * space for the result (using krb5_c_encrypt_length() to determine the amount + * of space needed). @a output->length will be set to the actual length of the + * ciphertext. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_encrypt(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_data *input, krb5_enc_data *output); + +/** + * Decrypt data using a key (operates on keyblock). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] cipher_state Cipher state; specify NULL if not needed + * @param [in] input Encrypted data + * @param [out] output Decrypted data + * + * This function decrypts the data block @a input and stores the output into @a + * output. The actual decryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the decryption operation, and + * is updated with the state to be passed as input to the next operation. + * + * @note The caller must initialize @a output and allocate at least enough + * space for the result. The usual practice is to allocate an output buffer as + * long as the ciphertext, and let krb5_c_decrypt() trim @a output->length. + * For some enctypes, the resulting @a output->length may include padding + * bytes. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_decrypt(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_enc_data *input, krb5_data *output); + +/** + * Compute encrypted data length. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] inputlen Length of the data to be encrypted + * @param [out] length Length of the encrypted data + * + * This function computes the length of the ciphertext produced by encrypting + * @a inputlen bytes including padding, confounder, and checksum. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_encrypt_length(krb5_context context, krb5_enctype enctype, + size_t inputlen, size_t *length); + +/** + * Return cipher block size. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [out] blocksize Block size for @a enctype + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_block_size(krb5_context context, krb5_enctype enctype, + size_t *blocksize); + +/** + * Return length of the specified key in bytes. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [out] keybytes Number of bytes required to make a key + * @param [out] keylength Length of final key + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_keylengths(krb5_context context, krb5_enctype enctype, + size_t *keybytes, size_t *keylength); + +/** + * Initialize a new cipher state. + * + * @param [in] context Library context + * @param [in] key Key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [out] new_state New cipher state + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_init_state(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, krb5_data *new_state); + +/** + * Free a cipher state previously allocated by krb5_c_init_state(). + * + * @param [in] context Library context + * @param [in] key Key + * @param [in] state Cipher state to be freed + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_free_state(krb5_context context, const krb5_keyblock *key, + krb5_data *state); + +/** + * Generate enctype-specific pseudo-random bytes. + * + * @param [in] context Library context + * @param [in] keyblock Key + * @param [in] input Input data + * @param [out] output Output data + * + * This function selects a pseudo-random function based on @a keyblock and + * computes its value over @a input, placing the result into @a output. + * The caller must preinitialize @a output and allocate space for the + * result, using krb5_c_prf_length() to determine the required length. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock, + krb5_data *input, krb5_data *output); + +/** + * Get the output length of pseudo-random functions for an encryption type. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [out] len Length of PRF output + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_prf_length(krb5_context context, krb5_enctype enctype, size_t *len); + +/** + * Generate pseudo-random bytes using RFC 6113 PRF+. + * + * @param [in] context Library context + * @param [in] k KDC contribution key + * @param [in] input Input data + * @param [out] output Pseudo-random output buffer + * + * This function fills @a output with PRF+(k, input) as defined in RFC 6113 + * section 5.1. The caller must preinitialize @a output and allocate the + * desired amount of space. The length of the pseudo-random output will match + * the length of @a output. + * + * @note RFC 4402 defines a different PRF+ operation. This function does not + * implement that operation. + * + * @return 0 on success, @c E2BIG if output->length is too large for PRF+ to + * generate, @c ENOMEM on allocation failure, or an error code from + * krb5_c_prf() + */ +krb5_error_code KRB5_CALLCONV +krb5_c_prfplus(krb5_context context, const krb5_keyblock *k, + const krb5_data *input, krb5_data *output); + +/** + * Derive a key using some input data (via RFC 6113 PRF+). + * + * @param [in] context Library context + * @param [in] k KDC contribution key + * @param [in] input Input string + * @param [in] enctype Output key enctype (or @c ENCTYPE_NULL) + * @param [out] out Derived keyblock + * + * This function uses PRF+ as defined in RFC 6113 to derive a key from another + * key and an input string. If @a enctype is @c ENCTYPE_NULL, the output key + * will have the same enctype as the input key. + */ +krb5_error_code KRB5_CALLCONV +krb5_c_derive_prfplus(krb5_context context, const krb5_keyblock *k, + const krb5_data *input, krb5_enctype enctype, + krb5_keyblock **out); + +/** + * Compute the KRB-FX-CF2 combination of two keys and pepper strings. + * + * @param [in] context Library context + * @param [in] k1 KDC contribution key + * @param [in] pepper1 String "PKINIT" + * @param [in] k2 Reply key + * @param [in] pepper2 String "KeyExchange" + * @param [out] out Output key + * + * This function computes the KRB-FX-CF2 function over its inputs and places + * the results in a newly allocated keyblock. This function is simple in that + * it assumes that @a pepper1 and @a pepper2 are C strings with no internal + * nulls and that the enctype of the result will be the same as that of @a k1. + * @a k1 and @a k2 may be of different enctypes. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_fx_cf2_simple(krb5_context context, + const krb5_keyblock *k1, const char *pepper1, + const krb5_keyblock *k2, const char *pepper2, + krb5_keyblock **out); + +/** + * Generate an enctype-specific random encryption key. + * + * @param [in] context Library context + * @param [in] enctype Encryption type of the generated key + * @param [out] k5_random_key An allocated and initialized keyblock + * + * Use krb5_free_keyblock_contents() to free @a k5_random_key when + * no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_make_random_key(krb5_context context, krb5_enctype enctype, + krb5_keyblock *k5_random_key); + +/** + * Generate an enctype-specific key from random data. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] random_data Random input data + * @param [out] k5_random_key Resulting key + * + * This function takes random input data @a random_data and produces a valid + * key @a k5_random_key for a given @a enctype. + * + * @note It is assumed that @a k5_random_key has already been initialized and + * @a k5_random_key->contents has been allocated with the correct length. + * + * @sa krb5_c_keylengths() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_random_to_key(krb5_context context, krb5_enctype enctype, + krb5_data *random_data, krb5_keyblock *k5_random_key); + +/** @deprecated This call is no longer necessary. */ +krb5_error_code KRB5_CALLCONV +krb5_c_random_add_entropy(krb5_context context, unsigned int randsource, + const krb5_data *data); + +/** + * Generate pseudo-random bytes. + * + * @param [in] context Library context + * @param [out] data Random data + * + * Fills in @a data with bytes from the PRNG used by krb5 crypto operations. + * The caller must preinitialize @a data and allocate the desired amount of + * space. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_random_make_octets(krb5_context context, krb5_data *data); + +/** @deprecated This call is no longer necessary. */ +krb5_error_code KRB5_CALLCONV +krb5_c_random_os_entropy(krb5_context context, int strong, int *success); + +/** @deprecated This call is no longer necessary. */ +krb5_error_code KRB5_CALLCONV +krb5_c_random_seed(krb5_context context, krb5_data *data); + +/** + * Convert a string (such a password) to a key. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] string String to be converted + * @param [in] salt Salt value + * @param [out] key Generated key + * + * This function converts @a string to a @a key of encryption type @a enctype, + * using the specified @a salt. The newly created @a key must be released by + * calling krb5_free_keyblock_contents() when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_string_to_key(krb5_context context, krb5_enctype enctype, + const krb5_data *string, const krb5_data *salt, + krb5_keyblock *key); + +/** + * Convert a string (such as a password) to a key with additional parameters. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] string String to be converted + * @param [in] salt Salt value + * @param [in] params Parameters + * @param [out] key Generated key + * + * This function is similar to krb5_c_string_to_key(), but also takes + * parameters which may affect the algorithm in an enctype-dependent way. The + * newly created @a key must be released by calling + * krb5_free_keyblock_contents() when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_string_to_key_with_params(krb5_context context, + krb5_enctype enctype, + const krb5_data *string, + const krb5_data *salt, + const krb5_data *params, + krb5_keyblock *key); + +/** + * Compare two encryption types. + * + * @param [in] context Library context + * @param [in] e1 First encryption type + * @param [in] e2 Second encryption type + * @param [out] similar @c TRUE if types are similar, @c FALSE if not + * + * This function determines whether two encryption types use the same kind of + * keys. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_enctype_compare(krb5_context context, krb5_enctype e1, krb5_enctype e2, + krb5_boolean *similar); + +/** + * Compute a checksum (operates on keyblock). + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] input Input data + * @param [out] cksum Generated checksum + * + * This function computes a checksum of type @a cksumtype over @a input, using + * @a key if the checksum type is a keyed checksum. If @a cksumtype is 0 and + * @a key is non-null, the checksum type will be the mandatory-to-implement + * checksum type for the key's encryption type. The actual checksum key will + * be derived from @a key and @a usage if key derivation is specified for the + * checksum type. The newly created @a cksum must be released by calling + * krb5_free_checksum_contents() when it is no longer needed. + * + * @note This function is similar to krb5_k_make_checksum(), but operates + * on keyblock @a key. + * + * @sa krb5_c_verify_checksum() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_make_checksum(krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_checksum *cksum); + +/** + * Verify a checksum (operates on keyblock). + * + * @param [in] context Library context + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage @a key usage + * @param [in] data Data to be used to compute a new checksum + * using @a key to compare @a cksum against + * @param [in] cksum Checksum to be verified + * @param [out] valid Non-zero for success, zero for failure + * + * This function verifies that @a cksum is a valid checksum for @a data. If + * the checksum type of @a cksum is a keyed checksum, @a key is used to verify + * the checksum. If the checksum type in @a cksum is 0 and @a key is not NULL, + * the mandatory checksum type for @a key will be used. The actual checksum + * key will be derived from @a key and @a usage if key derivation is specified + * for the checksum type. + * + * @note This function is similar to krb5_k_verify_checksum(), but operates + * on keyblock @a key. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_verify_checksum(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *data, + const krb5_checksum *cksum, krb5_boolean *valid); + +/** + * Return the length of checksums for a checksum type. + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type + * @param [out] length Checksum length + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype, + size_t *length); + +/** + * Return a list of keyed checksum types usable with an encryption type. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [out] count Count of allowable checksum types + * @param [out] cksumtypes Array of allowable checksum types + * + * Use krb5_free_cksumtypes() to free @a cksumtypes when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_keyed_checksum_types(krb5_context context, krb5_enctype enctype, + unsigned int *count, krb5_cksumtype **cksumtypes); + +#define KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS 1 +#define KRB5_KEYUSAGE_KDC_REP_TICKET 2 +#define KRB5_KEYUSAGE_AS_REP_ENCPART 3 +#define KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY 4 +#define KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY 5 +#define KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM 6 +#define KRB5_KEYUSAGE_TGS_REQ_AUTH 7 +#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY 8 +#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY 9 +#define KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM 10 +#define KRB5_KEYUSAGE_AP_REQ_AUTH 11 +#define KRB5_KEYUSAGE_AP_REP_ENCPART 12 +#define KRB5_KEYUSAGE_KRB_PRIV_ENCPART 13 +#define KRB5_KEYUSAGE_KRB_CRED_ENCPART 14 +#define KRB5_KEYUSAGE_KRB_SAFE_CKSUM 15 +#define KRB5_KEYUSAGE_APP_DATA_ENCRYPT 16 +#define KRB5_KEYUSAGE_APP_DATA_CKSUM 17 +#define KRB5_KEYUSAGE_KRB_ERROR_CKSUM 18 +#define KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM 19 +#define KRB5_KEYUSAGE_AD_MTE 20 +#define KRB5_KEYUSAGE_AD_ITE 21 + +/* XXX need to register these */ + +#define KRB5_KEYUSAGE_GSS_TOK_MIC 22 +#define KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG 23 +#define KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV 24 + +/* Defined in Integrating SAM Mechanisms with Kerberos draft */ +#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM 25 +/* Note conflict with KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST */ +#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID 26 +/* Note conflict with KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY */ +#define KRB5_KEYUSAGE_PA_SAM_RESPONSE 27 + +/* Defined in [MS-SFU] */ +/* Note conflict with KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID */ +#define KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST 26 +/* Note conflict with KRB5_KEYUSAGE_PA_SAM_RESPONSE */ +#define KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY 27 + +/* unused */ +#define KRB5_KEYUSAGE_PA_REFERRAL 26 + +#define KRB5_KEYUSAGE_AD_SIGNEDPATH -21 +#define KRB5_KEYUSAGE_FINISHED 41 +#define KRB5_KEYUSAGE_IAKERB_FINISHED 42 +#define KRB5_KEYUSAGE_PA_PKINIT_KX 44 +#define KRB5_KEYUSAGE_PA_OTP_REQUEST 45 /**< See RFC 6560 section 4.2 */ +/* define in draft-ietf-krb-wg-preauth-framework*/ +#define KRB5_KEYUSAGE_FAST_REQ_CHKSUM 50 +#define KRB5_KEYUSAGE_FAST_ENC 51 +#define KRB5_KEYUSAGE_FAST_REP 52 +#define KRB5_KEYUSAGE_FAST_FINISHED 53 +#define KRB5_KEYUSAGE_ENC_CHALLENGE_CLIENT 54 +#define KRB5_KEYUSAGE_ENC_CHALLENGE_KDC 55 +#define KRB5_KEYUSAGE_AS_REQ 56 +#define KRB5_KEYUSAGE_CAMMAC 64 +#define KRB5_KEYUSAGE_SPAKE 65 + +/* Key usage values 512-1023 are reserved for uses internal to a Kerberos + * implementation. */ +#define KRB5_KEYUSAGE_PA_FX_COOKIE 513 /**< Used for encrypted FAST cookies */ +#define KRB5_KEYUSAGE_PA_AS_FRESHNESS 514 /**< Used for freshness tokens */ + +/** + * Verify that a specified encryption type is a valid Kerberos encryption type. + * + * @param [in] ktype Encryption type + * + * @return @c TRUE if @a ktype is valid, @c FALSE if not + */ +krb5_boolean KRB5_CALLCONV +krb5_c_valid_enctype(krb5_enctype ktype); + +/** + * Verify that specified checksum type is a valid Kerberos checksum type. + * + * @param [in] ctype Checksum type + * + * @return @c TRUE if @a ctype is valid, @c FALSE if not + */ +krb5_boolean KRB5_CALLCONV +krb5_c_valid_cksumtype(krb5_cksumtype ctype); + +/** + * Test whether a checksum type is collision-proof. + * + * @param [in] ctype Checksum type + * + * @return @c TRUE if @a ctype is collision-proof, @c FALSE if it is not + * collision-proof or not a valid checksum type. + */ +krb5_boolean KRB5_CALLCONV +krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype); + +/** + * Test whether a checksum type is keyed. + * + * @param [in] ctype Checksum type + * + * @return @c TRUE if @a ctype is a keyed checksum type, @c FALSE otherwise. + */ +krb5_boolean KRB5_CALLCONV +krb5_c_is_keyed_cksum(krb5_cksumtype ctype); + +/* AEAD APIs */ +#define KRB5_CRYPTO_TYPE_EMPTY 0 /**< [in] ignored */ +#define KRB5_CRYPTO_TYPE_HEADER 1 /**< [out] header */ +#define KRB5_CRYPTO_TYPE_DATA 2 /**< [in, out] plaintext */ +#define KRB5_CRYPTO_TYPE_SIGN_ONLY 3 /**< [in] associated data */ +#define KRB5_CRYPTO_TYPE_PADDING 4 /**< [out] padding */ +#define KRB5_CRYPTO_TYPE_TRAILER 5 /**< [out] checksum for encrypt */ +#define KRB5_CRYPTO_TYPE_CHECKSUM 6 /**< [out] checksum for MIC */ +#define KRB5_CRYPTO_TYPE_STREAM 7 /**< [in] entire message without + decomposing the structure into + header, data and trailer buffers */ + +/** + * Fill in a checksum element in IOV array (operates on keyblock) + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] data IOV array + * @param [in] num_data Size of @a data + * + * Create a checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element over + * #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY chunks in @a data. + * Only the #KRB5_CRYPTO_TYPE_CHECKSUM region is modified. + * + * @note This function is similar to krb5_k_make_checksum_iov(), but operates + * on keyblock @a key. + * + * @sa krb5_c_verify_checksum_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_make_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + krb5_crypto_iov *data, size_t num_data); + +/** + * Validate a checksum element in IOV array (operates on keyblock). + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] data IOV array + * @param [in] num_data Size of @a data + * @param [out] valid Non-zero for success, zero for failure + * + * Confirm that the checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element is a + * valid checksum of the #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY + * regions in the iov. + * + * @note This function is similar to krb5_k_verify_checksum_iov(), but operates + * on keyblock @a key. + * + * @sa krb5_c_make_checksum_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_verify_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_crypto_iov *data, size_t num_data, + krb5_boolean *valid); + +/** + * Encrypt data in place supporting AEAD (operates on keyblock). + * + * @param [in] context Library context + * @param [in] keyblock Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] cipher_state Cipher state; specify NULL if not needed + * @param [in,out] data IOV array. Modified in-place. + * @param [in] num_data Size of @a data + * + * This function encrypts the data block @a data and stores the output in-place. + * The actual encryption key will be derived from @a keyblock and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the encryption operation, and + * is updated with the state to be passed as input to the next operation. + * The caller must allocate the right number of krb5_crypto_iov + * structures before calling into this API. + * + * @note On return from a krb5_c_encrypt_iov() call, the @a data->length in the + * iov structure are adjusted to reflect actual lengths of the ciphertext used. + * For example, if the padding length is too large, the length will be reduced. + * Lengths are never increased. + * + * @note This function is similar to krb5_k_encrypt_iov(), but operates + * on keyblock @a keyblock. + * + * @sa krb5_c_decrypt_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_encrypt_iov(krb5_context context, const krb5_keyblock *keyblock, + krb5_keyusage usage, const krb5_data *cipher_state, + krb5_crypto_iov *data, size_t num_data); + +/** + * Decrypt data in place supporting AEAD (operates on keyblock). + * + * @param [in] context Library context + * @param [in] keyblock Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] cipher_state Cipher state; specify NULL if not needed + * @param [in,out] data IOV array. Modified in-place. + * @param [in] num_data Size of @a data + * + * This function decrypts the data block @a data and stores the output in-place. + * The actual decryption key will be derived from @a keyblock and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the decryption operation, and + * is updated with the state to be passed as input to the next operation. + * The caller must allocate the right number of krb5_crypto_iov + * structures before calling into this API. + * + * @note On return from a krb5_c_decrypt_iov() call, the @a data->length in the + * iov structure are adjusted to reflect actual lengths of the ciphertext used. + * For example, if the padding length is too large, the length will be reduced. + * Lengths are never increased. + * + * @note This function is similar to krb5_k_decrypt_iov(), but operates + * on keyblock @a keyblock. + * + * @sa krb5_c_decrypt_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_decrypt_iov(krb5_context context, const krb5_keyblock *keyblock, + krb5_keyusage usage, const krb5_data *cipher_state, + krb5_crypto_iov *data, size_t num_data); + +/** + * Return a length of a message field specific to the encryption type. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] type Type field (See KRB5_CRYPTO_TYPE macros) + * @param [out] size Length of the @a type specific to @a enctype + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_crypto_length(krb5_context context, krb5_enctype enctype, + krb5_cryptotype type, unsigned int *size); + +/** + * Fill in lengths for header, trailer and padding in a IOV array. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in,out] data IOV array + * @param [in] num_data Size of @a data + * + * Padding is set to the actual padding required based on the provided + * @a data buffers. Typically this API is used after setting up the data + * buffers and #KRB5_CRYPTO_TYPE_SIGN_ONLY buffers, but before actually + * allocating header, trailer and padding. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_c_crypto_length_iov(krb5_context context, krb5_enctype enctype, + krb5_crypto_iov *data, size_t num_data); + +/** + * Return a number of padding octets. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] data_length Length of the plaintext to pad + * @param [out] size Number of padding octets + * + * This function returns the number of the padding octets required to pad + * @a data_length octets of plaintext. + * + * @retval 0 Success; otherwise - KRB5_BAD_ENCTYPE + */ +krb5_error_code KRB5_CALLCONV +krb5_c_padding_length(krb5_context context, krb5_enctype enctype, + size_t data_length, unsigned int *size); + +/** + * Create a krb5_key from the enctype and key data in a keyblock. + * + * @param [in] context Library context + * @param [in] key_data Keyblock + * @param [out] out Opaque key + * + * The reference count on a key @a out is set to 1. + * Use krb5_k_free_key() to free @a out when it is no longer needed. + * + * @retval 0 Success; otherwise - KRB5_BAD_ENCTYPE + */ +krb5_error_code KRB5_CALLCONV +krb5_k_create_key(krb5_context context, const krb5_keyblock *key_data, + krb5_key *out); + +/** Increment the reference count on a key. */ +void KRB5_CALLCONV +krb5_k_reference_key(krb5_context context, krb5_key key); + +/** Decrement the reference count on a key and free it if it hits zero. */ +void KRB5_CALLCONV +krb5_k_free_key(krb5_context context, krb5_key key); + +/** Retrieve a copy of the keyblock from a krb5_key structure. */ +krb5_error_code KRB5_CALLCONV +krb5_k_key_keyblock(krb5_context context, krb5_key key, + krb5_keyblock **key_data); + +/** Retrieve the enctype of a krb5_key structure. */ +krb5_enctype KRB5_CALLCONV +krb5_k_key_enctype(krb5_context context, krb5_key key); + +/** + * Encrypt data using a key (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] cipher_state Cipher state; specify NULL if not needed + * @param [in] input Data to be encrypted + * @param [out] output Encrypted data + * + * This function encrypts the data block @a input and stores the output into @a + * output. The actual encryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the encryption operation, and + * is updated with the state to be passed as input to the next operation. + * + * @note The caller must initialize @a output and allocate at least enough + * space for the result (using krb5_c_encrypt_length() to determine the amount + * of space needed). @a output->length will be set to the actual length of the + * ciphertext. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_encrypt(krb5_context context, krb5_key key, krb5_keyusage usage, + const krb5_data *cipher_state, const krb5_data *input, + krb5_enc_data *output); + +/** + * Encrypt data in place supporting AEAD (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] cipher_state Cipher state; specify NULL if not needed + * @param [in,out] data IOV array. Modified in-place. + * @param [in] num_data Size of @a data + * + * This function encrypts the data block @a data and stores the output in-place. + * The actual encryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the encryption operation, and + * is updated with the state to be passed as input to the next operation. + * The caller must allocate the right number of krb5_crypto_iov + * structures before calling into this API. + * + * @note On return from a krb5_c_encrypt_iov() call, the @a data->length in the + * iov structure are adjusted to reflect actual lengths of the ciphertext used. + * For example, if the padding length is too large, the length will be reduced. + * Lengths are never increased. + * + * @note This function is similar to krb5_c_encrypt_iov(), but operates + * on opaque key @a key. + * + * @sa krb5_k_decrypt_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_encrypt_iov(krb5_context context, krb5_key key, krb5_keyusage usage, + const krb5_data *cipher_state, krb5_crypto_iov *data, + size_t num_data); + +/** + * Decrypt data using a key (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] cipher_state Cipher state; specify NULL if not needed + * @param [in] input Encrypted data + * @param [out] output Decrypted data + * + * This function decrypts the data block @a input and stores the output into @a + * output. The actual decryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the decryption operation, and + * is updated with the state to be passed as input to the next operation. + * + * @note The caller must initialize @a output and allocate at least enough + * space for the result. The usual practice is to allocate an output buffer as + * long as the ciphertext, and let krb5_c_decrypt() trim @a output->length. + * For some enctypes, the resulting @a output->length may include padding + * bytes. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_decrypt(krb5_context context, krb5_key key, krb5_keyusage usage, + const krb5_data *cipher_state, const krb5_enc_data *input, + krb5_data *output); + +/** + * Decrypt data in place supporting AEAD (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Encryption key + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] cipher_state Cipher state; specify NULL if not needed + * @param [in,out] data IOV array. Modified in-place. + * @param [in] num_data Size of @a data + * + * This function decrypts the data block @a data and stores the output in-place. + * The actual decryption key will be derived from @a key and @a usage + * if key derivation is specified for the encryption type. If non-null, @a + * cipher_state specifies the beginning state for the decryption operation, and + * is updated with the state to be passed as input to the next operation. + * The caller must allocate the right number of krb5_crypto_iov + * structures before calling into this API. + * + * @note On return from a krb5_c_decrypt_iov() call, the @a data->length in the + * iov structure are adjusted to reflect actual lengths of the ciphertext used. + * For example, if the padding length is too large, the length will be reduced. + * Lengths are never increased. + * + * @note This function is similar to krb5_c_decrypt_iov(), but operates + * on opaque key @a key. + * + * @sa krb5_k_encrypt_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_decrypt_iov(krb5_context context, krb5_key key, krb5_keyusage usage, + const krb5_data *cipher_state, krb5_crypto_iov *data, + size_t num_data); +/** + * Compute a checksum (operates on opaque key). + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] input Input data + * @param [out] cksum Generated checksum + * + * This function computes a checksum of type @a cksumtype over @a input, using + * @a key if the checksum type is a keyed checksum. If @a cksumtype is 0 and + * @a key is non-null, the checksum type will be the mandatory-to-implement + * checksum type for the key's encryption type. The actual checksum key will + * be derived from @a key and @a usage if key derivation is specified for the + * checksum type. The newly created @a cksum must be released by calling + * krb5_free_checksum_contents() when it is no longer needed. + * + * @note This function is similar to krb5_c_make_checksum(), but operates + * on opaque @a key. + * + * @sa krb5_c_verify_checksum() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, + krb5_key key, krb5_keyusage usage, const krb5_data *input, + krb5_checksum *cksum); + +/** + * Fill in a checksum element in IOV array (operates on opaque key) + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in,out] data IOV array + * @param [in] num_data Size of @a data + * + * Create a checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element over + * #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY chunks in @a data. + * Only the #KRB5_CRYPTO_TYPE_CHECKSUM region is modified. + * + * @note This function is similar to krb5_c_make_checksum_iov(), but operates + * on opaque @a key. + * + * @sa krb5_k_verify_checksum_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_make_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, + krb5_key key, krb5_keyusage usage, + krb5_crypto_iov *data, size_t num_data); + +/** + * Verify a checksum (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage @a key usage + * @param [in] data Data to be used to compute a new checksum + * using @a key to compare @a cksum against + * @param [in] cksum Checksum to be verified + * @param [out] valid Non-zero for success, zero for failure + * + * This function verifies that @a cksum is a valid checksum for @a data. If + * the checksum type of @a cksum is a keyed checksum, @a key is used to verify + * the checksum. If the checksum type in @a cksum is 0 and @a key is not NULL, + * the mandatory checksum type for @a key will be used. The actual checksum + * key will be derived from @a key and @a usage if key derivation is specified + * for the checksum type. + * + * @note This function is similar to krb5_c_verify_checksum(), but operates + * on opaque @a key. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_verify_checksum(krb5_context context, krb5_key key, krb5_keyusage usage, + const krb5_data *data, const krb5_checksum *cksum, + krb5_boolean *valid); + +/** + * Validate a checksum element in IOV array (operates on opaque key). + * + * @param [in] context Library context + * @param [in] cksumtype Checksum type (0 for mandatory type) + * @param [in] key Encryption key for a keyed checksum + * @param [in] usage Key usage (see KRB5_KEYUSAGE macros) + * @param [in] data IOV array + * @param [in] num_data Size of @a data + * @param [out] valid Non-zero for success, zero for failure + * + * Confirm that the checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element is a + * valid checksum of the #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY + * regions in the iov. + * + * @note This function is similar to krb5_c_verify_checksum_iov(), but operates + * on opaque @a key. + * + * @sa krb5_k_make_checksum_iov() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_verify_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, + krb5_key key, krb5_keyusage usage, + const krb5_crypto_iov *data, size_t num_data, + krb5_boolean *valid); + +/** + * Generate enctype-specific pseudo-random bytes (operates on opaque key). + * + * @param [in] context Library context + * @param [in] key Key + * @param [in] input Input data + * @param [out] output Output data + * + * This function selects a pseudo-random function based on @a key and + * computes its value over @a input, placing the result into @a output. + * The caller must preinitialize @a output and allocate space for the + * result. + * + * @note This function is similar to krb5_c_prf(), but operates + * on opaque @a key. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_k_prf(krb5_context context, krb5_key key, krb5_data *input, krb5_data *output); + +#ifdef KRB5_OLD_CRYPTO +/* + * old cryptosystem routine prototypes. These are now layered + * on top of the functions above. + */ +/** @deprecated Replaced by krb5_c_* API family.*/ +krb5_error_code KRB5_CALLCONV +krb5_encrypt(krb5_context context, krb5_const_pointer inptr, + krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, + krb5_pointer ivec); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_decrypt(krb5_context context, krb5_const_pointer inptr, + krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, + krb5_pointer ivec); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_process_key(krb5_context context, krb5_encrypt_block *eblock, + const krb5_keyblock * key); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_finish_key(krb5_context context, krb5_encrypt_block * eblock); + +/** @deprecated See krb5_c_string_to_key() */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_keyblock * keyblock, const krb5_data *data, + const krb5_data *salt); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_init_random_key(krb5_context context, const krb5_encrypt_block *eblock, + const krb5_keyblock *keyblock, krb5_pointer *ptr); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_finish_random_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_pointer *ptr); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_random_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_pointer ptr, krb5_keyblock **keyblock); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_enctype KRB5_CALLCONV +krb5_eblock_enctype(krb5_context context, const krb5_encrypt_block *eblock); + +/** @deprecated Replaced by krb5_c_* API family. */ +krb5_error_code KRB5_CALLCONV +krb5_use_enctype(krb5_context context, krb5_encrypt_block *eblock, + krb5_enctype enctype); + +/** @deprecated Replaced by krb5_c_* API family. */ +size_t KRB5_CALLCONV +krb5_encrypt_size(size_t length, krb5_enctype crypto); + +/** @deprecated See krb5_c_checksum_length() */ +size_t KRB5_CALLCONV +krb5_checksum_size(krb5_context context, krb5_cksumtype ctype); + +/** @deprecated See krb5_c_make_checksum() */ +krb5_error_code KRB5_CALLCONV +krb5_calculate_checksum(krb5_context context, krb5_cksumtype ctype, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length, + krb5_checksum * outcksum); + +/** @deprecated See krb5_c_verify_checksum() */ +krb5_error_code KRB5_CALLCONV +krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype, + const krb5_checksum * cksum, krb5_const_pointer in, + size_t in_length, krb5_const_pointer seed, + size_t seed_length); + +#endif /* KRB5_OLD_CRYPTO */ + +/* + * end "encryption.h" + */ + +/* + * begin "fieldbits.h" + */ + +/* kdc_options for kdc_request */ +/* options is 32 bits; each host is responsible to put the 4 bytes + representing these bits into net order before transmission */ +/* #define KDC_OPT_RESERVED 0x80000000 */ +#define KDC_OPT_FORWARDABLE 0x40000000 +#define KDC_OPT_FORWARDED 0x20000000 +#define KDC_OPT_PROXIABLE 0x10000000 +#define KDC_OPT_PROXY 0x08000000 +#define KDC_OPT_ALLOW_POSTDATE 0x04000000 +#define KDC_OPT_POSTDATED 0x02000000 +/* #define KDC_OPT_UNUSED 0x01000000 */ +#define KDC_OPT_RENEWABLE 0x00800000 +/* #define KDC_OPT_UNUSED 0x00400000 */ +/* #define KDC_OPT_RESERVED 0x00200000 */ +/* #define KDC_OPT_RESERVED 0x00100000 */ +/* #define KDC_OPT_RESERVED 0x00080000 */ +/* #define KDC_OPT_RESERVED 0x00040000 */ +#define KDC_OPT_CNAME_IN_ADDL_TKT 0x00020000 +#define KDC_OPT_CANONICALIZE 0x00010000 +#define KDC_OPT_REQUEST_ANONYMOUS 0x00008000 +/* #define KDC_OPT_RESERVED 0x00004000 */ +/* #define KDC_OPT_RESERVED 0x00002000 */ +/* #define KDC_OPT_RESERVED 0x00001000 */ +/* #define KDC_OPT_RESERVED 0x00000800 */ +/* #define KDC_OPT_RESERVED 0x00000400 */ +/* #define KDC_OPT_RESERVED 0x00000200 */ +/* #define KDC_OPT_RESERVED 0x00000100 */ +/* #define KDC_OPT_RESERVED 0x00000080 */ +/* #define KDC_OPT_RESERVED 0x00000040 */ +#define KDC_OPT_DISABLE_TRANSITED_CHECK 0x00000020 +#define KDC_OPT_RENEWABLE_OK 0x00000010 +#define KDC_OPT_ENC_TKT_IN_SKEY 0x00000008 +/* #define KDC_OPT_UNUSED 0x00000004 */ +#define KDC_OPT_RENEW 0x00000002 +#define KDC_OPT_VALIDATE 0x00000001 + +/* + * Mask of ticket flags in the TGT which should be converted into KDC + * options when using the TGT to get derivative tickets. + * + * New mask = KDC_OPT_FORWARDABLE | KDC_OPT_PROXIABLE | + * KDC_OPT_ALLOW_POSTDATE | KDC_OPT_RENEWABLE + */ +#define KDC_TKT_COMMON_MASK 0x54800000 + +/* definitions for ap_options fields */ + +/* + * ap_options are 32 bits; each host is responsible to put the 4 bytes + * representing these bits into net order before transmission + */ +#define AP_OPTS_RESERVED 0x80000000 +#define AP_OPTS_USE_SESSION_KEY 0x40000000 /**< Use session key */ +#define AP_OPTS_MUTUAL_REQUIRED 0x20000000 /**< Perform a mutual + authentication exchange */ +#define AP_OPTS_CBT_FLAG 0x00000004 /* include KERB_AP_OPTIONS_CBT */ +#define AP_OPTS_ETYPE_NEGOTIATION 0x00000002 +#define AP_OPTS_USE_SUBKEY 0x00000001 /**< Generate a subsession key + from the current session key + obtained from the + credentials */ +/* #define AP_OPTS_RESERVED 0x10000000 */ +/* #define AP_OPTS_RESERVED 0x08000000 */ +/* #define AP_OPTS_RESERVED 0x04000000 */ +/* #define AP_OPTS_RESERVED 0x02000000 */ +/* #define AP_OPTS_RESERVED 0x01000000 */ +/* #define AP_OPTS_RESERVED 0x00800000 */ +/* #define AP_OPTS_RESERVED 0x00400000 */ +/* #define AP_OPTS_RESERVED 0x00200000 */ +/* #define AP_OPTS_RESERVED 0x00100000 */ +/* #define AP_OPTS_RESERVED 0x00080000 */ +/* #define AP_OPTS_RESERVED 0x00040000 */ +/* #define AP_OPTS_RESERVED 0x00020000 */ +/* #define AP_OPTS_RESERVED 0x00010000 */ +/* #define AP_OPTS_RESERVED 0x00008000 */ +/* #define AP_OPTS_RESERVED 0x00004000 */ +/* #define AP_OPTS_RESERVED 0x00002000 */ +/* #define AP_OPTS_RESERVED 0x00001000 */ +/* #define AP_OPTS_RESERVED 0x00000800 */ +/* #define AP_OPTS_RESERVED 0x00000400 */ +/* #define AP_OPTS_RESERVED 0x00000200 */ +/* #define AP_OPTS_RESERVED 0x00000100 */ +/* #define AP_OPTS_RESERVED 0x00000080 */ +/* #define AP_OPTS_RESERVED 0x00000040 */ +/* #define AP_OPTS_RESERVED 0x00000020 */ +/* #define AP_OPTS_RESERVED 0x00000010 */ +/* #define AP_OPTS_RESERVED 0x00000008 */ + + +#define AP_OPTS_WIRE_MASK 0xfffffff0 + +/* definitions for ad_type fields. */ +#define AD_TYPE_RESERVED 0x8000 +#define AD_TYPE_EXTERNAL 0x4000 +#define AD_TYPE_REGISTERED 0x2000 + +#define AD_TYPE_FIELD_TYPE_MASK 0x1fff + +/* Ticket flags */ +/* flags are 32 bits; each host is responsible to put the 4 bytes + representing these bits into net order before transmission */ +/* #define TKT_FLG_RESERVED 0x80000000 */ +#define TKT_FLG_FORWARDABLE 0x40000000 +#define TKT_FLG_FORWARDED 0x20000000 +#define TKT_FLG_PROXIABLE 0x10000000 +#define TKT_FLG_PROXY 0x08000000 +#define TKT_FLG_MAY_POSTDATE 0x04000000 +#define TKT_FLG_POSTDATED 0x02000000 +#define TKT_FLG_INVALID 0x01000000 +#define TKT_FLG_RENEWABLE 0x00800000 +#define TKT_FLG_INITIAL 0x00400000 +#define TKT_FLG_PRE_AUTH 0x00200000 +#define TKT_FLG_HW_AUTH 0x00100000 +#define TKT_FLG_TRANSIT_POLICY_CHECKED 0x00080000 +#define TKT_FLG_OK_AS_DELEGATE 0x00040000 +#define TKT_FLG_ENC_PA_REP 0x00010000 +#define TKT_FLG_ANONYMOUS 0x00008000 +/* #define TKT_FLG_RESERVED 0x00004000 */ +/* #define TKT_FLG_RESERVED 0x00002000 */ +/* #define TKT_FLG_RESERVED 0x00001000 */ +/* #define TKT_FLG_RESERVED 0x00000800 */ +/* #define TKT_FLG_RESERVED 0x00000400 */ +/* #define TKT_FLG_RESERVED 0x00000200 */ +/* #define TKT_FLG_RESERVED 0x00000100 */ +/* #define TKT_FLG_RESERVED 0x00000080 */ +/* #define TKT_FLG_RESERVED 0x00000040 */ +/* #define TKT_FLG_RESERVED 0x00000020 */ +/* #define TKT_FLG_RESERVED 0x00000010 */ +/* #define TKT_FLG_RESERVED 0x00000008 */ +/* #define TKT_FLG_RESERVED 0x00000004 */ +/* #define TKT_FLG_RESERVED 0x00000002 */ +/* #define TKT_FLG_RESERVED 0x00000001 */ + +/* definitions for lr_type fields. */ +#define LR_TYPE_THIS_SERVER_ONLY 0x8000 + +#define LR_TYPE_INTERPRETATION_MASK 0x7fff + +/* definitions for msec direction bit for KRB_SAFE, KRB_PRIV */ +#define MSEC_DIRBIT 0x8000 +#define MSEC_VAL_MASK 0x7fff + +/* + * end "fieldbits.h" + */ + +/* + * begin "proto.h" + */ + +/** Protocol version number */ +#define KRB5_PVNO 5 + +/* Message types */ + +#define KRB5_AS_REQ ((krb5_msgtype)10) /**< Initial authentication request */ +#define KRB5_AS_REP ((krb5_msgtype)11) /**< Response to AS request */ +#define KRB5_TGS_REQ ((krb5_msgtype)12) /**< Ticket granting server request */ +#define KRB5_TGS_REP ((krb5_msgtype)13) /**< Response to TGS request */ +#define KRB5_AP_REQ ((krb5_msgtype)14) /**< Auth req to application server */ +#define KRB5_AP_REP ((krb5_msgtype)15) /**< Response to mutual AP request */ +#define KRB5_SAFE ((krb5_msgtype)20) /**< Safe application message */ +#define KRB5_PRIV ((krb5_msgtype)21) /**< Private application message */ +#define KRB5_CRED ((krb5_msgtype)22) /**< Cred forwarding message */ +#define KRB5_ERROR ((krb5_msgtype)30) /**< Error response */ + +/* LastReq types */ +#define KRB5_LRQ_NONE 0 +#define KRB5_LRQ_ALL_LAST_TGT 1 +#define KRB5_LRQ_ONE_LAST_TGT (-1) +#define KRB5_LRQ_ALL_LAST_INITIAL 2 +#define KRB5_LRQ_ONE_LAST_INITIAL (-2) +#define KRB5_LRQ_ALL_LAST_TGT_ISSUED 3 +#define KRB5_LRQ_ONE_LAST_TGT_ISSUED (-3) +#define KRB5_LRQ_ALL_LAST_RENEWAL 4 +#define KRB5_LRQ_ONE_LAST_RENEWAL (-4) +#define KRB5_LRQ_ALL_LAST_REQ 5 +#define KRB5_LRQ_ONE_LAST_REQ (-5) +#define KRB5_LRQ_ALL_PW_EXPTIME 6 +#define KRB5_LRQ_ONE_PW_EXPTIME (-6) +#define KRB5_LRQ_ALL_ACCT_EXPTIME 7 +#define KRB5_LRQ_ONE_ACCT_EXPTIME (-7) + +/* PADATA types */ +#define KRB5_PADATA_NONE 0 +#define KRB5_PADATA_AP_REQ 1 +#define KRB5_PADATA_TGS_REQ KRB5_PADATA_AP_REQ +#define KRB5_PADATA_ENC_TIMESTAMP 2 /**< RFC 4120 */ +#define KRB5_PADATA_PW_SALT 3 /**< RFC 4120 */ +#if 0 /* Not used */ +#define KRB5_PADATA_ENC_ENCKEY 4 /* Key encrypted within itself */ +#endif +#define KRB5_PADATA_ENC_UNIX_TIME 5 /**< timestamp encrypted in key. RFC 4120 */ +#define KRB5_PADATA_ENC_SANDIA_SECURID 6 /**< SecurId passcode. RFC 4120 */ +#define KRB5_PADATA_SESAME 7 /**< Sesame project. RFC 4120 */ +#define KRB5_PADATA_OSF_DCE 8 /**< OSF DCE. RFC 4120 */ +#define KRB5_CYBERSAFE_SECUREID 9 /**< Cybersafe. RFC 4120 */ +#define KRB5_PADATA_AFS3_SALT 10 /**< Cygnus. RFC 4120, 3961 */ +#define KRB5_PADATA_ETYPE_INFO 11 /**< Etype info for preauth. RFC 4120 */ +#define KRB5_PADATA_SAM_CHALLENGE 12 /**< SAM/OTP */ +#define KRB5_PADATA_SAM_RESPONSE 13 /**< SAM/OTP */ +#define KRB5_PADATA_PK_AS_REQ_OLD 14 /**< PKINIT */ +#define KRB5_PADATA_PK_AS_REP_OLD 15 /**< PKINIT */ +#define KRB5_PADATA_PK_AS_REQ 16 /**< PKINIT. RFC 4556 */ +#define KRB5_PADATA_PK_AS_REP 17 /**< PKINIT. RFC 4556 */ +#define KRB5_PADATA_ETYPE_INFO2 19 /**< RFC 4120 */ +#define KRB5_PADATA_USE_SPECIFIED_KVNO 20 /**< RFC 4120 */ +#define KRB5_PADATA_SVR_REFERRAL_INFO 20 /**< Windows 2000 referrals. RFC 6820 */ +#define KRB5_PADATA_SAM_REDIRECT 21 /**< SAM/OTP. RFC 4120 */ +#define KRB5_PADATA_GET_FROM_TYPED_DATA 22 /**< Embedded in typed data. RFC 4120 */ +#define KRB5_PADATA_REFERRAL 25 /**< draft referral system */ +#define KRB5_PADATA_SAM_CHALLENGE_2 30 /**< draft challenge system, updated */ +#define KRB5_PADATA_SAM_RESPONSE_2 31 /**< draft challenge system, updated */ +/* MS-KILE */ +#define KRB5_PADATA_PAC_REQUEST 128 /**< include Windows PAC */ +#define KRB5_PADATA_FOR_USER 129 /**< username protocol transition request */ +#define KRB5_PADATA_S4U_X509_USER 130 /**< certificate protocol transition request */ +#define KRB5_PADATA_AS_CHECKSUM 132 /**< AS checksum */ +#define KRB5_PADATA_FX_COOKIE 133 /**< RFC 6113 */ +#define KRB5_PADATA_FX_FAST 136 /**< RFC 6113 */ +#define KRB5_PADATA_FX_ERROR 137 /**< RFC 6113 */ +#define KRB5_PADATA_ENCRYPTED_CHALLENGE 138 /**< RFC 6113 */ +#define KRB5_PADATA_OTP_CHALLENGE 141 /**< RFC 6560 section 4.1 */ +#define KRB5_PADATA_OTP_REQUEST 142 /**< RFC 6560 section 4.2 */ +#define KRB5_PADATA_OTP_PIN_CHANGE 144 /**< RFC 6560 section 4.3 */ +#define KRB5_PADATA_PKINIT_KX 147 /**< RFC 6112 */ +#define KRB5_ENCPADATA_REQ_ENC_PA_REP 149 /**< RFC 6806 */ +#define KRB5_PADATA_AS_FRESHNESS 150 /**< RFC 8070 */ +#define KRB5_PADATA_SPAKE 151 +#define KRB5_PADATA_REDHAT_IDP_OAUTH2 152 /**< Red Hat IdP mechanism */ +#define KRB5_PADATA_REDHAT_PASSKEY 153 /**< Red Hat Passkey mechanism */ +#define KRB5_PADATA_PAC_OPTIONS 167 /**< MS-KILE and MS-SFU */ + +#define KRB5_SAM_USE_SAD_AS_KEY 0x80000000 +#define KRB5_SAM_SEND_ENCRYPTED_SAD 0x40000000 +#define KRB5_SAM_MUST_PK_ENCRYPT_SAD 0x20000000 /**< currently must be zero */ + +/** Transited encoding types */ +#define KRB5_DOMAIN_X500_COMPRESS 1 + +/** alternate authentication types */ +#define KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE 64 + +/* authorization data types. See RFC 4120 section 5.2.6 */ + +#define KRB5_AUTHDATA_IF_RELEVANT 1 +#define KRB5_AUTHDATA_KDC_ISSUED 4 +#define KRB5_AUTHDATA_AND_OR 5 +#define KRB5_AUTHDATA_MANDATORY_FOR_KDC 8 +#define KRB5_AUTHDATA_INITIAL_VERIFIED_CAS 9 +#define KRB5_AUTHDATA_OSF_DCE 64 +#define KRB5_AUTHDATA_SESAME 65 +#define KRB5_AUTHDATA_CAMMAC 96 +#define KRB5_AUTHDATA_WIN2K_PAC 128 +#define KRB5_AUTHDATA_ETYPE_NEGOTIATION 129 /**< RFC 4537 */ +#define KRB5_AUTHDATA_SIGNTICKET 512 /**< @deprecated use PAC */ +#define KRB5_AUTHDATA_FX_ARMOR 71 +#define KRB5_AUTHDATA_AUTH_INDICATOR 97 +#define KRB5_AUTHDATA_AP_OPTIONS 143 + +/* password change constants */ +#define KRB5_KPASSWD_SUCCESS 0 /**< Success */ +#define KRB5_KPASSWD_MALFORMED 1 /**< Malformed request */ +#define KRB5_KPASSWD_HARDERROR 2 /**< Server error */ +#define KRB5_KPASSWD_AUTHERROR 3 /**< Authentication error */ +#define KRB5_KPASSWD_SOFTERROR 4 /**< Password change rejected */ +/* These are Microsoft's extensions in RFC 3244, and it looks like + they'll become standardized, possibly with other additions. */ +#define KRB5_KPASSWD_ACCESSDENIED 5 /**< Not authorized */ +#define KRB5_KPASSWD_BAD_VERSION 6 /**< Unknown RPC version */ +/** The presented credentials were not obtained using a password directly */ +#define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7 + +/* + * end "proto.h" + */ + +/* Time set */ +/** Ticket start time, end time, and renewal duration. */ +typedef struct _krb5_ticket_times { + krb5_timestamp authtime; /**< Time at which KDC issued the initial ticket that corresponds to this ticket */ + /* XXX ? should ktime in KDC_REP == authtime + in ticket? otherwise client can't get this */ + krb5_timestamp starttime; /**< optional in ticket, if not present, use @a authtime */ + krb5_timestamp endtime; /**< Ticket expiration time */ + krb5_timestamp renew_till; /**< Latest time at which renewal of ticket can be valid */ +} krb5_ticket_times; + +/** Structure for auth data */ +typedef struct _krb5_authdata { + krb5_magic magic; + krb5_authdatatype ad_type; /**< ADTYPE */ + unsigned int length; /**< Length of data */ + krb5_octet *contents; /**< Data */ +} krb5_authdata; + +/** Structure for transited encoding */ +typedef struct _krb5_transited { + krb5_magic magic; + krb5_octet tr_type; /**< Transited encoding type */ + krb5_data tr_contents; /**< Contents */ +} krb5_transited; + +/** Encrypted part of ticket. */ +typedef struct _krb5_enc_tkt_part { + krb5_magic magic; + /* to-be-encrypted portion */ + krb5_flags flags; /**< flags */ + krb5_keyblock *session; /**< session key: includes enctype */ + krb5_principal client; /**< client name/realm */ + krb5_transited transited; /**< list of transited realms */ + krb5_ticket_times times; /**< auth, start, end, renew_till */ + krb5_address **caddrs; /**< array of ptrs to addresses */ + krb5_authdata **authorization_data; /**< auth data */ +} krb5_enc_tkt_part; + +/** + * Ticket structure. + * + * The C representation of the ticket message, with a pointer to the + * C representation of the encrypted part. + */ +typedef struct _krb5_ticket { + krb5_magic magic; + /* cleartext portion */ + krb5_principal server; /**< server name/realm */ + krb5_enc_data enc_part; /**< encryption type, kvno, encrypted encoding */ + krb5_enc_tkt_part *enc_part2; /**< ptr to decrypted version, if available */ +} krb5_ticket; + +/* the unencrypted version */ +/** + * Ticket authenticator. + * + * The C representation of an unencrypted authenticator. + */ +typedef struct _krb5_authenticator { + krb5_magic magic; + krb5_principal client; /**< client name/realm */ + krb5_checksum *checksum; /**< checksum, includes type, optional */ + krb5_int32 cusec; /**< client usec portion */ + krb5_timestamp ctime; /**< client sec portion */ + krb5_keyblock *subkey; /**< true session key, optional */ + krb5_ui_4 seq_number; /**< sequence #, optional */ + krb5_authdata **authorization_data; /**< authoriazation data */ +} krb5_authenticator; + +/** Ticket authentication data. */ +typedef struct _krb5_tkt_authent { + krb5_magic magic; + krb5_ticket *ticket; + krb5_authenticator *authenticator; + krb5_flags ap_options; +} krb5_tkt_authent; + +/** Credentials structure including ticket, session key, and lifetime info. */ +typedef struct _krb5_creds { + krb5_magic magic; + krb5_principal client; /**< client's principal identifier */ + krb5_principal server; /**< server's principal identifier */ + krb5_keyblock keyblock; /**< session encryption key info */ + krb5_ticket_times times; /**< lifetime info */ + krb5_boolean is_skey; /**< true if ticket is encrypted in + another ticket's skey */ + krb5_flags ticket_flags; /**< flags in ticket */ + krb5_address **addresses; /**< addrs in ticket */ + krb5_data ticket; /**< ticket string itself */ + krb5_data second_ticket; /**< second ticket, if related to + ticket (via DUPLICATE-SKEY or + ENC-TKT-IN-SKEY) */ + krb5_authdata **authdata; /**< authorization data */ +} krb5_creds; + +/** Last request entry */ +typedef struct _krb5_last_req_entry { + krb5_magic magic; + krb5_int32 lr_type; /**< LR type */ + krb5_timestamp value; /**< Timestamp */ +} krb5_last_req_entry; + +/** Pre-authentication data */ +typedef struct _krb5_pa_data { + krb5_magic magic; + krb5_preauthtype pa_type; /**< Preauthentication data type */ + unsigned int length; /**< Length of data */ + krb5_octet *contents; /**< Data */ +} krb5_pa_data; + +/* Don't use this; use krb5_pa_data instead. */ +typedef struct _krb5_typed_data { + krb5_magic magic; + krb5_int32 type; + unsigned int length; + krb5_octet *data; +} krb5_typed_data; + +/** C representation of KDC-REQ protocol message, including KDC-REQ-BODY */ +typedef struct _krb5_kdc_req { + krb5_magic magic; + krb5_msgtype msg_type; /**< KRB5_AS_REQ or KRB5_TGS_REQ */ + krb5_pa_data **padata; /**< Preauthentication data */ + /* real body */ + krb5_flags kdc_options; /**< Requested options */ + krb5_principal client; /**< Client principal and realm */ + krb5_principal server; /**< Server principal and realm */ + krb5_timestamp from; /**< Requested start time */ + krb5_timestamp till; /**< Requested end time */ + krb5_timestamp rtime; /**< Requested renewable end time */ + krb5_int32 nonce; /**< Nonce to match request and response */ + int nktypes; /**< Number of enctypes */ + krb5_enctype *ktype; /**< Requested enctypes */ + krb5_address **addresses; /**< Requested addresses (optional) */ + krb5_enc_data authorization_data; /**< Encrypted authz data (optional) */ + krb5_authdata **unenc_authdata; /**< Unencrypted authz data */ + krb5_ticket **second_ticket; /**< Second ticket array (optional) */ +} krb5_kdc_req; + +/** + * C representation of @c EncKDCRepPart protocol message. + * + * This is the cleartext message that is encrypted and inserted in @c KDC-REP. + */ +typedef struct _krb5_enc_kdc_rep_part { + krb5_magic magic; + /* encrypted part: */ + krb5_msgtype msg_type; /**< krb5 message type */ + krb5_keyblock *session; /**< Session key */ + krb5_last_req_entry **last_req; /**< Array of pointers to entries */ + krb5_int32 nonce; /**< Nonce from request */ + krb5_timestamp key_exp; /**< Expiration date */ + krb5_flags flags; /**< Ticket flags */ + krb5_ticket_times times; /**< Lifetime info */ + krb5_principal server; /**< Server's principal identifier */ + krb5_address **caddrs; /**< Array of ptrs to addrs, optional */ + krb5_pa_data **enc_padata; /**< Encrypted preauthentication data */ +} krb5_enc_kdc_rep_part; + +/** Representation of the @c KDC-REP protocol message. */ +typedef struct _krb5_kdc_rep { + krb5_magic magic; + /* cleartext part: */ + krb5_msgtype msg_type; /**< KRB5_AS_REP or KRB5_KDC_REP */ + krb5_pa_data **padata; /**< Preauthentication data from KDC */ + krb5_principal client; /**< Client principal and realm */ + krb5_ticket *ticket; /**< Ticket */ + krb5_enc_data enc_part; /**< Encrypted part of reply */ + krb5_enc_kdc_rep_part *enc_part2; /**< Unencrypted version, if available */ +} krb5_kdc_rep; + +/** Error message structure */ +typedef struct _krb5_error { + krb5_magic magic; + /* some of these may be meaningless in certain contexts */ + krb5_timestamp ctime; /**< Client sec portion; optional */ + krb5_int32 cusec; /**< Client usec portion; optional */ + krb5_int32 susec; /**< Server usec portion */ + krb5_timestamp stime; /**< Server sec portion */ + krb5_ui_4 error; /**< Error code (protocol error #'s) */ + krb5_principal client; /**< Client principal and realm */ + krb5_principal server; /**< Server principal and realm */ + krb5_data text; /**< Descriptive text */ + krb5_data e_data; /**< Additional error-describing data */ +} krb5_error; + +/** Authentication header. */ +typedef struct _krb5_ap_req { + krb5_magic magic; + krb5_flags ap_options; /**< Requested options */ + krb5_ticket *ticket; /**< Ticket */ + krb5_enc_data authenticator; /**< Encrypted authenticator */ +} krb5_ap_req; + +/** + * C representaton of AP-REP message. + * + * The server's response to a client's request for mutual authentication. + */ +typedef struct _krb5_ap_rep { + krb5_magic magic; + krb5_enc_data enc_part; /**< Ciphertext of ApRepEncPart */ +} krb5_ap_rep; + +/** Cleartext that is encrypted and put into @c _krb5_ap_rep. */ +typedef struct _krb5_ap_rep_enc_part { + krb5_magic magic; + krb5_timestamp ctime; /**< Client time, seconds portion */ + krb5_int32 cusec; /**< Client time, microseconds portion */ + krb5_keyblock *subkey; /**< Subkey (optional) */ + krb5_ui_4 seq_number; /**< Sequence number */ +} krb5_ap_rep_enc_part; + +/* Unused */ +typedef struct _krb5_response { + krb5_magic magic; + krb5_octet message_type; + krb5_data response; + krb5_int32 expected_nonce; + krb5_timestamp request_time; +} krb5_response; + +/** Credentials information inserted into @c EncKrbCredPart. */ +typedef struct _krb5_cred_info { + krb5_magic magic; + krb5_keyblock *session; /**< Session key used to encrypt ticket */ + krb5_principal client; /**< Client principal and realm */ + krb5_principal server; /**< Server principal and realm */ + krb5_flags flags; /**< Ticket flags */ + krb5_ticket_times times; /**< Auth, start, end, renew_till */ + krb5_address **caddrs; /**< Array of pointers to addrs (optional) */ +} krb5_cred_info; + +/** Cleartext credentials information. */ +typedef struct _krb5_cred_enc_part { + krb5_magic magic; + krb5_int32 nonce; /**< Nonce (optional) */ + krb5_timestamp timestamp; /**< Generation time, seconds portion */ + krb5_int32 usec; /**< Generation time, microseconds portion */ + krb5_address *s_address; /**< Sender address (optional) */ + krb5_address *r_address; /**< Recipient address (optional) */ + krb5_cred_info **ticket_info; +} krb5_cred_enc_part; + +/** Credentials data structure.*/ +typedef struct _krb5_cred { + krb5_magic magic; + krb5_ticket **tickets; /**< Tickets */ + krb5_enc_data enc_part; /**< Encrypted part */ + krb5_cred_enc_part *enc_part2; /**< Unencrypted version, if available */ +} krb5_cred; + +/* Unused, but here for API compatibility. */ +typedef struct _passwd_phrase_element { + krb5_magic magic; + krb5_data *passwd; + krb5_data *phrase; +} passwd_phrase_element; + +/* Unused, but here for API compatibility. */ +typedef struct _krb5_pwd_data { + krb5_magic magic; + int sequence_count; + passwd_phrase_element **element; +} krb5_pwd_data; + +/* Unused, but here for API compatibility. */ +typedef struct _krb5_pa_svr_referral_data { + /** Referred name, only realm is required */ + krb5_principal principal; +} krb5_pa_svr_referral_data; + +/* Unused, but here for API compatibility. */ +typedef struct _krb5_pa_server_referral_data { + krb5_data *referred_realm; + krb5_principal true_principal_name; + krb5_principal requested_principal_name; + krb5_timestamp referral_valid_until; + krb5_checksum rep_cksum; +} krb5_pa_server_referral_data; + +typedef struct _krb5_pa_pac_req { + /** TRUE if a PAC should be included in TGS-REP */ + krb5_boolean include_pac; +} krb5_pa_pac_req; + +/* + * begin "safepriv.h" + */ + +/** Prevent replays with timestamps and replay cache. */ +#define KRB5_AUTH_CONTEXT_DO_TIME 0x00000001 +/** Save timestamps for application. */ +#define KRB5_AUTH_CONTEXT_RET_TIME 0x00000002 +/** Prevent replays with sequence numbers. */ +#define KRB5_AUTH_CONTEXT_DO_SEQUENCE 0x00000004 +/** Save sequence numbers for application. */ +#define KRB5_AUTH_CONTEXT_RET_SEQUENCE 0x00000008 +#define KRB5_AUTH_CONTEXT_PERMIT_ALL 0x00000010 +#define KRB5_AUTH_CONTEXT_USE_SUBKEY 0x00000020 + +/** + * Replay data. + * + * Sequence number and timestamp information output by krb5_rd_priv() and + * krb5_rd_safe(). + */ +typedef struct krb5_replay_data { + krb5_timestamp timestamp; /**< Timestamp, seconds portion */ + krb5_int32 usec; /**< Timestamp, microseconds portion */ + krb5_ui_4 seq; /**< Sequence number */ +} krb5_replay_data; + +/* Flags for krb5_auth_con_genaddrs(). */ + +/** Generate the local network address. */ +#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR 0x00000001 +/** Generate the remote network address. */ +#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR 0x00000002 +/** Generate the local network address and the local port. */ +#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR 0x00000004 +/** Generate the remote network address and the remote port. */ +#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR 0x00000008 + +/** Type of function used as a callback to generate checksum data for mk_req */ +typedef krb5_error_code +(KRB5_CALLCONV * krb5_mk_req_checksum_func)(krb5_context, krb5_auth_context, + void *, krb5_data **); + +/* + * end "safepriv.h" + */ + + +/* + * begin "ccache.h" + */ + +/** Cursor for sequential lookup */ +typedef krb5_pointer krb5_cc_cursor; + +struct _krb5_ccache; +typedef struct _krb5_ccache *krb5_ccache; +struct _krb5_cc_ops; +typedef struct _krb5_cc_ops krb5_cc_ops; + +struct _krb5_cccol_cursor; +/** Cursor for iterating over all ccaches */ +typedef struct _krb5_cccol_cursor *krb5_cccol_cursor; + +/* Flags for krb5_cc_retrieve_cred. */ +/** The requested lifetime must be at least as great as the time specified. */ +#define KRB5_TC_MATCH_TIMES 0x00000001 +/** The is_skey field must match exactly. */ +#define KRB5_TC_MATCH_IS_SKEY 0x00000002 +/** All the flags set in the match credentials must be set. */ +#define KRB5_TC_MATCH_FLAGS 0x00000004 +/** All the time fields must match exactly. */ +#define KRB5_TC_MATCH_TIMES_EXACT 0x00000008 +/** All the flags must match exactly. */ +#define KRB5_TC_MATCH_FLAGS_EXACT 0x00000010 +/** The authorization data must match. */ +#define KRB5_TC_MATCH_AUTHDATA 0x00000020 +/** Only the name portion of the principal name must match. */ +#define KRB5_TC_MATCH_SRV_NAMEONLY 0x00000040 +/** The second ticket must match. */ +#define KRB5_TC_MATCH_2ND_TKT 0x00000080 +/** The encryption key type must match. */ +#define KRB5_TC_MATCH_KTYPE 0x00000100 +/** The supported key types must match. */ +#define KRB5_TC_SUPPORTED_KTYPES 0x00000200 + +/* Flags for krb5_cc_set_flags and similar. */ +/** Open and close the file for each cache operation. */ +#define KRB5_TC_OPENCLOSE 0x00000001 /**< @deprecated has no effect */ +#define KRB5_TC_NOTICKET 0x00000002 + +/** + * Retrieve the name, but not type of a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * + * @warning Returns the name of the credential cache. The result is an alias + * into @a cache and should not be freed or modified by the caller. This name + * does not include the cache type, so should not be used as input to + * krb5_cc_resolve(). + * + * @return + * On success - the name of the credential cache. + */ +const char * KRB5_CALLCONV +krb5_cc_get_name(krb5_context context, krb5_ccache cache); + +/** + * Retrieve the full name of a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [out] fullname_out Full name of cache + * + * Use krb5_free_string() to free @a fullname_out when it is no longer needed. + * + * @version New in 1.10 + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_get_full_name(krb5_context context, krb5_ccache cache, + char **fullname_out); + +#if KRB5_DEPRECATED +krb5_error_code KRB5_CALLCONV +krb5_cc_gen_new(krb5_context context, krb5_ccache *cache); +#endif /* KRB5_DEPRECATED */ + +/** + * Initialize a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] principal Default principal name + * + * Destroy any existing contents of @a cache and initialize it for the default + * principal @a principal. + * + * @retval + * 0 Success + * @return + * System errors; Permission errors; Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_initialize(krb5_context context, krb5_ccache cache, + krb5_principal principal); + +/** + * Destroy a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * + * This function destroys any existing contents of @a cache and closes the + * handle to it. + * + * @retval + * 0 Success + * @return + * Permission errors + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_destroy(krb5_context context, krb5_ccache cache); + +/** + * Close a credential cache handle. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * + * This function closes a credential cache handle @a cache without affecting + * the contents of the cache. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_close(krb5_context context, krb5_ccache cache); + +/** + * Store credentials in a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] creds Credentials to be stored in cache + * + * This function stores @a creds into @a cache. If @a creds->server and the + * server in the decoded ticket @a creds->ticket differ, the credentials will + * be stored under both server principal names. + * + * @retval + * 0 Success + * @return Permission errors; storage failure errors; Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_store_cred(krb5_context context, krb5_ccache cache, krb5_creds *creds); + +/** + * Retrieve a specified credentials from a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] flags Flags bit mask + * @param [in] mcreds Credentials to match + * @param [out] creds Credentials matching the requested value + * + * This function searches a credential cache for credentials matching @a mcreds + * and returns it if found. + * + * Valid values for @a flags are: + * + * @li #KRB5_TC_MATCH_TIMES The requested lifetime must be at least as + * great as in @a mcreds . + * @li #KRB5_TC_MATCH_IS_SKEY The @a is_skey field much match exactly. + * @li #KRB5_TC_MATCH_FLAGS Flags set in @a mcreds must be set. + * @li #KRB5_TC_MATCH_TIMES_EXACT The requested lifetime must match exactly. + * @li #KRB5_TC_MATCH_FLAGS_EXACT Flags must match exactly. + * @li #KRB5_TC_MATCH_AUTHDATA The authorization data must match. + * @li #KRB5_TC_MATCH_SRV_NAMEONLY Only the name portion of the principal + * name must match, not the realm. + * @li #KRB5_TC_MATCH_2ND_TKT The second tickets must match. + * @li #KRB5_TC_MATCH_KTYPE The encryption key types must match. + * @li #KRB5_TC_SUPPORTED_KTYPES Check all matching entries that have any + * supported encryption type and return the + * one with the encryption type listed earliest. + * + * Use krb5_free_cred_contents() to free @a creds when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_retrieve_cred(krb5_context context, krb5_ccache cache, + krb5_flags flags, krb5_creds *mcreds, + krb5_creds *creds); + +/** + * Get the default principal of a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [out] principal Primary principal + * + * Returns the default client principal of a credential cache as set by + * krb5_cc_initialize(). + * + * Use krb5_free_principal() to free @a principal when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_get_principal(krb5_context context, krb5_ccache cache, + krb5_principal *principal); + +/** + * Prepare to sequentially read every credential in a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [out] cursor Cursor + * + * krb5_cc_end_seq_get() must be called to complete the retrieve operation. + * + * @note If the cache represented by @a cache is modified between the time of + * the call to this function and the time of the final krb5_cc_end_seq_get(), + * these changes may not be reflected in the results of krb5_cc_next_cred() + * calls. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_start_seq_get(krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +/** + * Retrieve the next entry from the credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] cursor Cursor + * @param [out] creds Next credential cache entry + * + * This function fills in @a creds with the next entry in @a cache and advances + * @a cursor. + * + * Use krb5_free_cred_contents() to free @a creds when it is no longer needed. + * + * @sa krb5_cc_start_seq_get(), krb5_end_seq_get() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_next_cred(krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor, krb5_creds *creds); + +/** + * Finish a series of sequential processing credential cache entries. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] cursor Cursor + * + * This function finishes processing credential cache entries and invalidates + * @a cursor. + * + * @sa krb5_cc_start_seq_get(), krb5_cc_next_cred() + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_end_seq_get(krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +/** + * Remove credentials from a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] flags Bitwise-ORed search flags + * @param [in] creds Credentials to be matched + * + * @warning This function is not implemented for some cache types. + * + * This function accepts the same flag values as krb5_cc_retrieve_cred(). + * + * @retval KRB5_CC_NOSUPP Not implemented for this cache type + * @return No matches found; Data cannot be deleted; Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_remove_cred(krb5_context context, krb5_ccache cache, krb5_flags flags, + krb5_creds *creds); + +/** + * Set options flags on a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [in] flags Flag bit mask + * + * This function resets @a cache flags to @a flags. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_set_flags(krb5_context context, krb5_ccache cache, krb5_flags flags); + +/** + * Retrieve flags from a credential cache structure. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * @param [out] flags Flag bit mask + * + * @warning For memory credential cache always returns a flag mask of 0. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_get_flags(krb5_context context, krb5_ccache cache, krb5_flags *flags); + +/** + * Retrieve the type of a credential cache. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * + * @return The type of a credential cache as an alias that must not be modified + * or freed by the caller. + */ +const char * KRB5_CALLCONV +krb5_cc_get_type(krb5_context context, krb5_ccache cache); + +/** + * Move a credential cache. + * + * @param [in] context Library context + * @param [in] src The credential cache to move the content from + * @param [in] dst The credential cache to move the content to + * + * This function reinitializes @a dst and populates it with the credentials and + * default principal of @a src; then, if successful, destroys @a src. + * + * @retval + * 0 Success; @a src is closed. + * @return + * Kerberos error codes; @a src is still allocated. + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_move(krb5_context context, krb5_ccache src, krb5_ccache dst); + +/** + * Prepare to iterate over the collection of known credential caches. + * + * @param [in] context Library context + * @param [out] cursor Cursor + * + * Get a new cache iteration @a cursor that will iterate over all known + * credential caches independent of type. + * + * Use krb5_cccol_cursor_free() to release @a cursor when it is no longer + * needed. + * + * @sa krb5_cccol_cursor_next() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cccol_cursor_new(krb5_context context, krb5_cccol_cursor *cursor); + +/** + * Get the next credential cache in the collection. + * + * @param [in] context Library context + * @param [in] cursor Cursor + * @param [out] ccache Credential cache handle + * + * @note When all caches are iterated over and the end of the list is reached, + * @a ccache is set to NULL. + * + * Use krb5_cc_close() to close @a ccache when it is no longer needed. + * + * @sa krb5_cccol_cursor_new(), krb5_cccol_cursor_free() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cccol_cursor_next(krb5_context context, krb5_cccol_cursor cursor, + krb5_ccache *ccache); + +/** + * Free a credential cache collection cursor. + * + * @param [in] context Library context + * @param [in] cursor Cursor + * + * @sa krb5_cccol_cursor_new(), krb5_cccol_cursor_next() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cccol_cursor_free(krb5_context context, krb5_cccol_cursor *cursor); + +/** + * Check if the credential cache collection contains any initialized caches. + * + * @param [in] context Library context + * + * @version New in 1.11 + * + * @retval 0 At least one initialized cache is present in the collection + * @retval KRB5_CC_NOTFOUND The collection contains no caches + */ +krb5_error_code KRB5_CALLCONV +krb5_cccol_have_content(krb5_context context); + +/** + * Create a new credential cache of the specified type with a unique name. + * + * @param [in] context Library context + * @param [in] type Credential cache type name + * @param [in] hint Unused + * @param [out] id Credential cache handle + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_new_unique(krb5_context context, const char *type, const char *hint, + krb5_ccache *id); + +/* + * end "ccache.h" + */ + +/* + * begin "rcache.h" + */ + +struct krb5_rc_st; +typedef struct krb5_rc_st *krb5_rcache; + +/* + * end "rcache.h" + */ + +/* + * begin "keytab.h" + */ + + +/* XXX */ +#define MAX_KEYTAB_NAME_LEN 1100 /**< Long enough for MAXPATHLEN + some extra */ + +typedef krb5_pointer krb5_kt_cursor; + +/** A key table entry. */ +typedef struct krb5_keytab_entry_st { + krb5_magic magic; + krb5_principal principal; /**< Principal of this key */ + krb5_timestamp timestamp; /**< Time entry written to keytable */ + krb5_kvno vno; /**< Key version number */ + krb5_keyblock key; /**< The secret key */ +} krb5_keytab_entry; + +struct _krb5_kt; +typedef struct _krb5_kt *krb5_keytab; + +/** + * Return the type of a key table. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * + * @return The type of a key table as an alias that must not be modified or + * freed by the caller. + */ +const char * KRB5_CALLCONV +krb5_kt_get_type(krb5_context context, krb5_keytab keytab); + +/** + * Get a key table name. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * @param [out] name Key table name + * @param [in] namelen Maximum length to fill in name + * + * Fill @a name with the name of @a keytab including the type and delimiter. + * + * @sa MAX_KEYTAB_NAME_LEN + * + * @retval + * 0 Success + * @retval + * KRB5_KT_NAME_TOOLONG Key table name does not fit in @a namelen bytes + * + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name, + unsigned int namelen); + +/** + * Close a key table handle. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * + * @retval 0 + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_close(krb5_context context, krb5_keytab keytab); + +/** + * Get an entry from a key table. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * @param [in] principal Principal name + * @param [in] vno Key version number (0 for highest available) + * @param [in] enctype Encryption type (0 zero for any enctype) + * @param [out] entry Returned entry from key table + * + * Retrieve an entry from a key table which matches the @a keytab, @a + * principal, @a vno, and @a enctype. If @a vno is zero, retrieve the + * highest-numbered kvno matching the other fields. If @a enctype is 0, match + * any enctype. + * + * Use krb5_free_keytab_entry_contents() to free @a entry when it is no longer + * needed. + * + * @note If @a vno is zero, the function retrieves the highest-numbered-kvno + * entry that matches the specified principal. + * + * @retval + * 0 Success + * @retval + * Kerberos error codes on failure + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_get_entry(krb5_context context, krb5_keytab keytab, + krb5_const_principal principal, krb5_kvno vno, + krb5_enctype enctype, krb5_keytab_entry *entry); + +/** + * Start a sequential retrieval of key table entries. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * @param [out] cursor Cursor + * + * Prepare to read sequentially every key in the specified key table. Use + * krb5_kt_end_seq_get() to release the cursor when it is no longer needed. + * + * @sa krb5_kt_next_entry(), krb5_kt_end_seq_get() + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); + +/** + * Retrieve the next entry from the key table. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * @param [out] entry Returned key table entry + * @param [in] cursor Key table cursor + * + * Return the next sequential entry in @a keytab and advance @a cursor. + * Callers must release the returned entry with krb5_kt_free_entry(). + * + * @sa krb5_kt_start_seq_get(), krb5_kt_end_seq_get() + * + * @retval + * 0 Success + * @retval + * KRB5_KT_END - if the last entry was reached + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_next_entry(krb5_context context, krb5_keytab keytab, + krb5_keytab_entry *entry, krb5_kt_cursor *cursor); + +/** + * Release a keytab cursor. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * @param [out] cursor Cursor + * + * This function should be called to release the cursor created by + * krb5_kt_start_seq_get(). + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); + +/** + * Check if a keytab exists and contains entries. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * + * @version New in 1.11 + * + * @retval 0 Keytab exists and contains entries + * @retval KRB5_KT_NOTFOUND Keytab does not contain entries + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_have_content(krb5_context context, krb5_keytab keytab); + +/* + * end "keytab.h" + */ + +/* + * begin "func-proto.h" + */ + +#define KRB5_INIT_CONTEXT_SECURE 0x1 /**< Use secure context configuration */ +#define KRB5_INIT_CONTEXT_KDC 0x2 /**< Use KDC configuration if available */ + +/** + * Create a krb5 library context. + * + * @param [out] context Library context + * + * The @a context must be released by calling krb5_free_context() when + * it is no longer needed. + * + * @warning Any program or module that needs the Kerberos code to not trust the + * environment must use krb5_init_secure_context(), or clean out the + * environment. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_context(krb5_context *context); + +/** + * Create a krb5 library context using only configuration files. + * + * @param [out] context Library context + * + * Create a context structure, using only system configuration files. All + * information passed through the environment variables is ignored. + * + * The @a context must be released by calling krb5_free_context() when + * it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_secure_context(krb5_context *context); + +/** + * Create a krb5 library context using a specified profile. + * + * @param [in] profile Profile object (NULL to create default profile) + * @param [in] flags Context initialization flags + * @param [out] context Library context + * + * Create a context structure, optionally using a specified profile and + * initialization flags. If @a profile is NULL, the default profile will be + * created from config files. If @a profile is non-null, a copy of it will be + * made for the new context; the caller should still clean up its copy. Valid + * flag values are: + * + * @li #KRB5_INIT_CONTEXT_SECURE Ignore environment variables + * @li #KRB5_INIT_CONTEXT_KDC Use KDC configuration if creating profile + */ +krb5_error_code KRB5_CALLCONV +krb5_init_context_profile(struct _profile_t *profile, krb5_flags flags, + krb5_context *context); + +/** + * Free a krb5 library context. + * + * @param [in] context Library context + * + * This function frees a @a context that was created by krb5_init_context() + * or krb5_init_secure_context(). + */ +void KRB5_CALLCONV +krb5_free_context(krb5_context context); + +/** + * Copy a krb5_context structure. + * + * @param [in] ctx Library context + * @param [out] nctx_out New context structure + * + * The newly created context must be released by calling krb5_free_context() + * when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_context(krb5_context ctx, krb5_context *nctx_out); + +/** + * Return a list of default configuration filenames + * + * @param [out] filenames Configuration filename list + * + * Fill in @a filenames with a null-terminated list of configuration files + * which will be read by krb5_init_context() in the current process + * environment. + * + * Use krb5_free_config_files() to free @a filenames when it is no longer + * needed. + * + * @version New in 1.22 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_default_config_files(char ***filenames); + +/** + * Free a list allocated by krb5_get_default_config_files() + * + * @param [in] filenames Configuration filename list + * + * @version New in 1.22 + */ +void KRB5_CALLCONV +krb5_free_config_files(char **filenames); + +/** + * Set default TGS encryption types in a krb5_context structure. + * + * @param [in] context Library context + * @param [in] etypes Encryption type(s) to set + * + * This function sets the default enctype list for TGS requests + * made using @a context to @a etypes. + * + * @note This overrides the default list (from config file or built-in). + * + * @retval + * 0 Success + * @retval + * KRB5_PROG_ETYPE_NOSUPP Program lacks support for encryption type + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_set_default_tgs_enctypes(krb5_context context, const krb5_enctype *etypes); + +/** + * Return a list of encryption types permitted for session keys. + * + * @param [in] context Library context + * @param [out] ktypes Zero-terminated list of encryption types + * + * This function returns the list of encryption types permitted for session + * keys within @a context, as determined by configuration or by a previous call + * to krb5_set_default_tgs_enctypes(). + * + * Use krb5_free_enctypes() to free @a ktypes when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_permitted_enctypes(krb5_context context, krb5_enctype **ktypes); + +/** + * Test whether the Kerberos library was built with multithread support. + * + * @retval + * TRUE if the library is threadsafe; FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_is_thread_safe(void); + +/* libkrb.spec */ + +/** + * Decrypt a ticket using the specified key table. + * + * @param [in] context Library context + * @param [in] kt Key table + * @param [in] ticket Ticket to be decrypted + * + * This function takes a @a ticket as input and decrypts it using + * key data from @a kt. The result is placed into @a ticket->enc_part2. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_server_decrypt_ticket_keytab(krb5_context context, const krb5_keytab kt, + krb5_ticket *ticket); + +/** + * Free an array of credential structures. + * + * @param [in] context Library context + * @param [in] tgts Null-terminated array of credentials to free + * + * @note The last entry in the array @a tgts must be a NULL pointer. + */ +void KRB5_CALLCONV +krb5_free_tgt_creds(krb5_context context, krb5_creds **tgts); + +#define KRB5_GC_USER_USER 1 /**< Want user-user ticket */ +#define KRB5_GC_CACHED 2 /**< Want cached ticket only */ +#define KRB5_GC_CANONICALIZE 4 /**< Set canonicalize KDC option */ +#define KRB5_GC_NO_STORE 8 /**< Do not store in credential cache */ +#define KRB5_GC_FORWARDABLE 16 /**< Acquire forwardable tickets */ +#define KRB5_GC_NO_TRANSIT_CHECK 32 /**< Disable transited check */ +#define KRB5_GC_CONSTRAINED_DELEGATION 64 /**< Constrained delegation */ + +/** + * Get an additional ticket. + * + * @param [in] context Library context + * @param [in] options Options + * @param [in] ccache Credential cache handle + * @param [in] in_creds Input credentials + * @param [out] out_creds Output updated credentials + * + * Use @a ccache or a TGS exchange to get a service ticket matching @a + * in_creds. + * + * Valid values for @a options are: + * @li #KRB5_GC_CACHED Search only credential cache for the ticket + * @li #KRB5_GC_USER_USER Return a user to user authentication ticket + * + * @a in_creds must be non-null. @a in_creds->client and @a in_creds->server + * must be filled in to specify the client and the server respectively. If any + * authorization data needs to be requested for the service ticket (such as + * restrictions on how the ticket can be used), specify it in @a + * in_creds->authdata; otherwise set @a in_creds->authdata to NULL. The + * session key type is specified in @a in_creds->keyblock.enctype, if it is + * nonzero. + * + * If @a in_creds->times.endtime is specified, it is used as the requested + * expiration date if a TGS request is made. If @a in_creds->times.endtime is + * set to 0, the latest possible expiration date will be requested. The KDC or + * cache may return a ticket with an earlier expiration date. + * + * Any returned ticket and intermediate ticket-granting tickets are stored + * in @a ccache. + * + * Use krb5_free_creds() to free @a out_creds when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_credentials(krb5_context context, krb5_flags options, + krb5_ccache ccache, krb5_creds *in_creds, + krb5_creds **out_creds); + +/** + * Serialize a @c krb5_creds object. + * + * @param [in] context Library context + * @param [in] in_creds The credentials object to serialize + * @param [out] data_out The serialized credentials + * + * Serialize @a creds in the format used by the FILE ccache format (vesion 4) + * and KCM ccache protocol. + * + * Use krb5_free_data() to free @a data_out when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_marshal_credentials(krb5_context context, krb5_creds *in_creds, + krb5_data **data_out); + +/** + * Deserialize a @c krb5_creds object. + * + * @param [in] context Library context + * @param [in] data The serialized credentials + * @param [out] creds_out The resulting creds object + * + * Deserialize @a data to credentials in the format used by the FILE ccache + * format (vesion 4) and KCM ccache protocol. + * + * Use krb5_free_creds() to free @a creds_out when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_unmarshal_credentials(krb5_context context, const krb5_data *data, + krb5_creds **creds_out); + +/** @deprecated Replaced by krb5_get_validated_creds. */ +krb5_error_code KRB5_CALLCONV +krb5_get_credentials_validate(krb5_context context, krb5_flags options, + krb5_ccache ccache, krb5_creds *in_creds, + krb5_creds **out_creds); + +/** @deprecated Replaced by krb5_get_renewed_creds. */ +krb5_error_code KRB5_CALLCONV +krb5_get_credentials_renew(krb5_context context, krb5_flags options, + krb5_ccache ccache, krb5_creds *in_creds, + krb5_creds **out_creds); + +/** + * Create a @c KRB_AP_REQ message. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] ap_req_options Options (see AP_OPTS macros) + * @param [in] service Service name, or NULL to use @c "host" + * @param [in] hostname Host name, or NULL to use local hostname + * @param [in] in_data Application data to be checksummed in the + * authenticator, or NULL + * @param [in] ccache Credential cache used to obtain credentials + * for the desired service. + * @param [out] outbuf @c AP-REQ message + * + * This function is similar to krb5_mk_req_extended() except that it uses a + * given @a hostname, @a service, and @a ccache to construct a service + * principal name and obtain credentials. + * + * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_req(krb5_context context, krb5_auth_context *auth_context, + krb5_flags ap_req_options, const char *service, + const char *hostname, krb5_data *in_data, krb5_ccache ccache, + krb5_data *outbuf); + +/** + * Create a @c KRB_AP_REQ message using supplied credentials. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] ap_req_options Options (see AP_OPTS macros) + * @param [in] in_data Application data to be checksummed in the + * authenticator, or NULL + * @param [in] in_creds Credentials for the service with valid ticket + * and key + * @param [out] outbuf @c AP-REQ message + * + * Valid @a ap_req_options are: + * @li #AP_OPTS_USE_SESSION_KEY - Use the session key when creating the + * request used for user to user + * authentication. + * @li #AP_OPTS_MUTUAL_REQUIRED - Request a mutual authentication packet from + * the receiver. + * @li #AP_OPTS_USE_SUBKEY - Generate a subsession key from the current + * session key obtained from the credentials. + * + * This function creates a KRB_AP_REQ message using supplied credentials @a + * in_creds. @a auth_context may point to an existing auth context or to NULL, + * in which case a new one will be created. If @a in_data is non-null, a + * checksum of it will be included in the authenticator contained in the + * KRB_AP_REQ message. Use krb5_free_data_contents() to free @a outbuf when it + * is no longer needed. + * + * On successful return, the authenticator is stored in @a auth_context with + * the @a client and @a checksum fields nulled out. (This is to prevent + * pointer-sharing problems; the caller should not need these fields anyway, + * since the caller supplied them.) + * + * @sa krb5_mk_req() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_req_extended(krb5_context context, krb5_auth_context *auth_context, + krb5_flags ap_req_options, krb5_data *in_data, + krb5_creds *in_creds, krb5_data *outbuf); + +/** + * Format and encrypt a @c KRB_AP_REP message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] outbuf @c AP-REP message + * + * This function fills in @a outbuf with an AP-REP message using information + * from @a auth_context. + * + * If the flags in @a auth_context indicate that a sequence number should be + * used (either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or + * #KRB5_AUTH_CONTEXT_RET_SEQUENCE) and the local sequence number in @a + * auth_context is 0, a new number will be generated with + * krb5_generate_seq_number(). + * + * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_rep(krb5_context context, krb5_auth_context auth_context, krb5_data *outbuf); + +/** + * Format and encrypt a @c KRB_AP_REP message for DCE RPC. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] outbuf @c AP-REP message + * + * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_rep_dce(krb5_context context, krb5_auth_context auth_context, krb5_data *outbuf); + +/** + * Parse and decrypt a @c KRB_AP_REP message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] inbuf AP-REP message + * @param [out] repl Decrypted reply message + * + * This function parses, decrypts and verifies a message from @a inbuf and + * fills in @a repl with a pointer to allocated memory containing the fields + * from the encrypted response. + * + * Use krb5_free_ap_rep_enc_part() to free @a repl when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_rep(krb5_context context, krb5_auth_context auth_context, + const krb5_data *inbuf, krb5_ap_rep_enc_part **repl); + +/** + * Parse and decrypt a @c KRB_AP_REP message for DCE RPC. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] inbuf AP-REP message + * @param [out] nonce Sequence number from the decrypted reply + * + * This function parses, decrypts and verifies a message from @a inbuf and + * fills in @a nonce with a decrypted reply sequence number. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_rep_dce(krb5_context context, krb5_auth_context auth_context, + const krb5_data *inbuf, krb5_ui_4 *nonce); + +/** + * Format and encode a @c KRB_ERROR message. + * + * @param [in] context Library context + * @param [in] dec_err Error structure to be encoded + * @param [out] enc_err Encoded error structure + * + * This function creates a @c KRB_ERROR message in @a enc_err. Use + * krb5_free_data_contents() to free @a enc_err when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_error(krb5_context context, const krb5_error *dec_err, + krb5_data *enc_err); + +/** + * Decode a @c KRB-ERROR message. + * + * @param [in] context Library context + * @param [in] enc_errbuf Encoded error message + * @param [out] dec_error Decoded error message + * + * This function processes @c KRB-ERROR message @a enc_errbuf and returns + * an allocated structure @a dec_error containing the error message. + * Use krb5_free_error() to free @a dec_error when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_error(krb5_context context, const krb5_data *enc_errbuf, + krb5_error **dec_error); + +/** + * Process @c KRB-SAFE message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] inbuf @c KRB-SAFE message to be parsed + * @param [out] userdata_out Data parsed from @c KRB-SAFE message + * @param [out] rdata_out Replay data. Specify NULL if not needed + * + * This function parses a @c KRB-SAFE message, verifies its integrity, and + * stores its data into @a userdata_out. + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context. + * + * If @a auth_context has a remote address set, the address will be used to + * verify the sender address in the KRB-SAFE message. If @a auth_context has a + * local address set, it will be used to verify the receiver address in the + * KRB-SAFE message if the message contains one. + * + * If the #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag is set in @a auth_context, the + * sequence number of the KRB-SAFE message is checked against the remote + * sequence number field of @a auth_context. Otherwise, the sequence number is + * not used. + * + * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, then the + * timestamp in the message is verified to be within the permitted clock skew + * of the current time, and the message is checked against an in-memory replay + * cache to detect reflections or replays. + * + * Use krb5_free_data_contents() to free @a userdata_out when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_safe(krb5_context context, krb5_auth_context auth_context, + const krb5_data *inbuf, krb5_data *userdata_out, + krb5_replay_data *rdata_out); + +/** + * Process a @c KRB-PRIV message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication structure + * @param [in] inbuf @c KRB-PRIV message to be parsed + * @param [out] userdata_out Data parsed from @c KRB-PRIV message + * @param [out] rdata_out Replay data. Specify NULL if not needed + * + * This function parses a @c KRB-PRIV message, verifies its integrity, and + * stores its unencrypted data into @a userdata_out. + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context. + * + * If @a auth_context has a remote address set, the address will be used to + * verify the sender address in the KRB-PRIV message. If @a auth_context has a + * local address set, it will be used to verify the receiver address in the + * KRB-PRIV message if the message contains one. + * + * If the #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag is set in @a auth_context, the + * sequence number of the KRB-PRIV message is checked against the remote + * sequence number field of @a auth_context. Otherwise, the sequence number is + * not used. + * + * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, then the + * timestamp in the message is verified to be within the permitted clock skew + * of the current time, and the message is checked against an in-memory replay + * cache to detect reflections or replays. + * + * Use krb5_free_data_contents() to free @a userdata_out when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_priv(krb5_context context, krb5_auth_context auth_context, + const krb5_data *inbuf, krb5_data *userdata_out, + krb5_replay_data *rdata_out); + +/** + * Convert a string principal name to a krb5_principal structure. + * + * @param [in] context Library context + * @param [in] name String representation of a principal name + * @param [out] principal_out New principal + * + * Convert a string representation of a principal name to a krb5_principal + * structure. + * + * A string representation of a Kerberos name consists of one or more principal + * name components, separated by slashes, optionally followed by the \@ + * character and a realm name. If the realm name is not specified, the local + * realm is used. + * + * To use the slash and \@ symbols as part of a component (quoted) instead of + * using them as a component separator or as a realm prefix), put a backslash + * (\) character in front of the symbol. Similarly, newline, tab, backspace, + * and NULL characters can be included in a component by using @c n, @c t, @c b + * or @c 0, respectively. + * + * @note The realm in a Kerberos @a name cannot contain slash, colon, + * or NULL characters. + * + * Beginning with release 1.20, the name type of the principal will be inferred + * as @c KRB5_NT_SRV_INST or @c KRB5_NT_WELLKNOWN based on the principal name. + * The type will be @c KRB5_NT_PRINCIPAL if a type cannot be inferred. + * + * Use krb5_free_principal() to free @a principal_out when it is no longer + * needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_parse_name(krb5_context context, const char *name, + krb5_principal *principal_out); + +#define KRB5_PRINCIPAL_PARSE_NO_REALM 0x1 /**< Error if realm is present */ +#define KRB5_PRINCIPAL_PARSE_REQUIRE_REALM 0x2 /**< Error if realm is not present */ +#define KRB5_PRINCIPAL_PARSE_ENTERPRISE 0x4 /**< Create single-component + enterprise principle */ +#define KRB5_PRINCIPAL_PARSE_IGNORE_REALM 0x8 /**< Ignore realm if present */ +#define KRB5_PRINCIPAL_PARSE_NO_DEF_REALM 0x10 /**< Don't add default realm */ + +/** + * Convert a string principal name to a krb5_principal with flags. + * + * @param [in] context Library context + * @param [in] name String representation of a principal name + * @param [in] flags Flag + * @param [out] principal_out New principal + * + * Similar to krb5_parse_name(), this function converts a single-string + * representation of a principal name to a krb5_principal structure. + * + * The following flags are valid: + * @li #KRB5_PRINCIPAL_PARSE_NO_REALM - no realm must be present in @a name + * @li #KRB5_PRINCIPAL_PARSE_REQUIRE_REALM - realm must be present in @a name + * @li #KRB5_PRINCIPAL_PARSE_ENTERPRISE - create single-component enterprise + * principal + * @li #KRB5_PRINCIPAL_PARSE_IGNORE_REALM - ignore realm if present in @a name + * + * If @c KRB5_PRINCIPAL_PARSE_NO_REALM or @c KRB5_PRINCIPAL_PARSE_IGNORE_REALM + * is specified in @a flags, the realm of the new principal will be empty. + * Otherwise, the default realm for @a context will be used if @a name does not + * specify a realm. + * + * Use krb5_free_principal() to free @a principal_out when it is no longer + * needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_parse_name_flags(krb5_context context, const char *name, + int flags, krb5_principal *principal_out); + +/** + * Convert a krb5_principal structure to a string representation. + * + * @param [in] context Library context + * @param [in] principal Principal + * @param [out] name String representation of principal name + * + * The resulting string representation uses the format and quoting conventions + * described for krb5_parse_name(). + * + * Use krb5_free_unparsed_name() to free @a name when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_unparse_name(krb5_context context, krb5_const_principal principal, + char **name); + +/** + * Convert krb5_principal structure to string and length. + * + * @param [in] context Library context + * @param [in] principal Principal + * @param [in,out] name String representation of principal name + * @param [in,out] size Size of unparsed name + * + * This function is similar to krb5_unparse_name(), but allows the use of an + * existing buffer for the result. If size is not NULL, then @a name must + * point to either NULL or an existing buffer of at least the size pointed to + * by @a size. The buffer will be allocated or resized if necessary, with the + * new pointer stored into @a name. Whether or not the buffer is resized, the + * necessary space for the result, including null terminator, will be stored + * into @a size. + * + * If size is NULL, this function behaves exactly as krb5_unparse_name(). + * + * @retval + * 0 Success + * @return + * Kerberos error codes. On failure @a name is set to NULL + */ +krb5_error_code KRB5_CALLCONV +krb5_unparse_name_ext(krb5_context context, krb5_const_principal principal, + char **name, unsigned int *size); + +#define KRB5_PRINCIPAL_UNPARSE_SHORT 0x1 /**< Omit realm if it is the local realm */ +#define KRB5_PRINCIPAL_UNPARSE_NO_REALM 0x2 /**< Omit realm always */ +#define KRB5_PRINCIPAL_UNPARSE_DISPLAY 0x4 /**< Don't escape special characters */ + +/** + * Convert krb5_principal structure to a string with flags. + * + * @param [in] context Library context + * @param [in] principal Principal + * @param [in] flags Flags + * @param [out] name String representation of principal name + * + * Similar to krb5_unparse_name(), this function converts a krb5_principal + * structure to a string representation. + * + * The following flags are valid: + * @li #KRB5_PRINCIPAL_UNPARSE_SHORT - omit realm if it is the local realm + * @li #KRB5_PRINCIPAL_UNPARSE_NO_REALM - omit realm + * @li #KRB5_PRINCIPAL_UNPARSE_DISPLAY - do not quote special characters + * + * Use krb5_free_unparsed_name() to free @a name when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes. On failure @a name is set to NULL + */ +krb5_error_code KRB5_CALLCONV +krb5_unparse_name_flags(krb5_context context, krb5_const_principal principal, + int flags, char **name); + +/** + * Convert krb5_principal structure to string format with flags. + * + * @param [in] context Library context + * @param [in] principal Principal + * @param [in] flags Flags + * @param [out] name Single string format of principal name + * @param [out] size Size of unparsed name buffer + * + * @sa krb5_unparse_name() krb5_unparse_name_flags() krb5_unparse_name_ext() + * + * @retval + * 0 Success + * @return + * Kerberos error codes. On failure @a name is set to NULL + */ +krb5_error_code KRB5_CALLCONV +krb5_unparse_name_flags_ext(krb5_context context, krb5_const_principal principal, + int flags, char **name, unsigned int *size); + +/** + * Set the realm field of a principal + * + * @param [in] context Library context + * @param [in] principal Principal name + * @param [in] realm Realm name + * + * Set the realm name part of @a principal to @a realm, overwriting the + * previous realm. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_set_principal_realm(krb5_context context, krb5_principal principal, + const char *realm); + +/** + * Search a list of addresses for a specified address. + * + * @param [in] context Library context + * @param [in] addr Address to search for + * @param [in] addrlist Address list to be searched (or NULL) + * + * @note If @a addrlist contains only a NetBIOS addresses, it will be treated + * as a null list. + * + * @return + * TRUE if @a addr is listed in @a addrlist, or @c addrlist is NULL; FALSE + * otherwise + */ +krb5_boolean KRB5_CALLCONV_WRONG +krb5_address_search(krb5_context context, const krb5_address *addr, + krb5_address *const *addrlist); + +/** + * Compare two Kerberos addresses. + * + * @param [in] context Library context + * @param [in] addr1 First address to be compared + * @param [in] addr2 Second address to be compared + * + * @return + * TRUE if the addresses are the same, FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_address_compare(krb5_context context, const krb5_address *addr1, + const krb5_address *addr2); + +/** + * Return an ordering of the specified addresses. + * + * @param [in] context Library context + * @param [in] addr1 First address + * @param [in] addr2 Second address + * + * @retval 0 if The two addresses are the same + * @retval < 0 First address is less than second + * @retval > 0 First address is greater than second + */ +int KRB5_CALLCONV +krb5_address_order(krb5_context context, const krb5_address *addr1, + const krb5_address *addr2); + +/** + * Compare the realms of two principals. + * + * @param [in] context Library context + * @param [in] princ1 First principal + * @param [in] princ2 Second principal + * + * @retval + * TRUE if the realm names are the same; FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_realm_compare(krb5_context context, krb5_const_principal princ1, + krb5_const_principal princ2); + +/** + * Compare two principals. + * + * @param [in] context Library context + * @param [in] princ1 First principal + * @param [in] princ2 Second principal + * + * @retval + * TRUE if the principals are the same; FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_principal_compare(krb5_context context, + krb5_const_principal princ1, + krb5_const_principal princ2); + +/** + * Compare two principals ignoring realm components. + * + * @param [in] context Library context + * @param [in] princ1 First principal + * @param [in] princ2 Second principal + * + * Similar to krb5_principal_compare(), but do not compare the realm + * components of the principals. + * + * @retval + * TRUE if the principals are the same; FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_principal_compare_any_realm(krb5_context context, + krb5_const_principal princ1, + krb5_const_principal princ2); + +#define KRB5_PRINCIPAL_COMPARE_IGNORE_REALM 1 /**< ignore realm component */ +#define KRB5_PRINCIPAL_COMPARE_ENTERPRISE 2 /**< UPNs as real principals */ +#define KRB5_PRINCIPAL_COMPARE_CASEFOLD 4 /**< case-insensitive */ +#define KRB5_PRINCIPAL_COMPARE_UTF8 8 /**< treat principals as UTF-8 */ + +/** + * Compare two principals with additional flags. + * + * @param [in] context Library context + * @param [in] princ1 First principal + * @param [in] princ2 Second principal + * @param [in] flags Flags + * + * Valid flags are: + * @li #KRB5_PRINCIPAL_COMPARE_IGNORE_REALM - ignore realm component + * @li #KRB5_PRINCIPAL_COMPARE_ENTERPRISE - UPNs as real principals + * @li #KRB5_PRINCIPAL_COMPARE_CASEFOLD case-insensitive + * @li #KRB5_PRINCIPAL_COMPARE_UTF8 - treat principals as UTF-8 + * + * @sa krb5_principal_compare() + * + * @retval + * TRUE if the principal names are the same; FALSE otherwise + */ +krb5_boolean KRB5_CALLCONV +krb5_principal_compare_flags(krb5_context context, + krb5_const_principal princ1, + krb5_const_principal princ2, + int flags); + +/** + * Initialize an empty @c krb5_keyblock. + * + * @param [in] context Library context + * @param [in] enctype Encryption type + * @param [in] length Length of keyblock (or 0) + * @param [out] out New keyblock structure + * + * Initialize a new keyblock and allocate storage for the contents of the key. + * It is legal to pass in a length of 0, in which case contents are left + * unallocated. Use krb5_free_keyblock() to free @a out when it is no longer + * needed. + * + * @note If @a length is set to 0, contents are left unallocated. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_keyblock(krb5_context context, krb5_enctype enctype, + size_t length, krb5_keyblock **out); + +/** + * Copy a keyblock. + * + * @param [in] context Library context + * @param [in] from Keyblock to be copied + * @param [out] to Copy of keyblock @a from + * + * This function creates a new keyblock with the same contents as @a from. Use + * krb5_free_keyblock() to free @a to when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_keyblock(krb5_context context, const krb5_keyblock *from, + krb5_keyblock **to); + +/** + * Copy the contents of a keyblock. + * + * @param [in] context Library context + * @param [in] from Key to be copied + * @param [out] to Output key + * + * This function copies the contents of @a from to @a to. Use + * krb5_free_keyblock_contents() to free @a to when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_keyblock_contents(krb5_context context, const krb5_keyblock *from, + krb5_keyblock *to); + +/** + * Copy a krb5_creds structure. + * + * @param [in] context Library context + * @param [in] incred Credentials structure to be copied + * @param [out] outcred Copy of @a incred + * + * This function creates a new credential with the contents of @a incred. Use + * krb5_free_creds() to free @a outcred when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_creds(krb5_context context, const krb5_creds *incred, krb5_creds **outcred); + +/** + * Copy a krb5_data object. + * + * @param [in] context Library context + * @param [in] indata Data object to be copied + * @param [out] outdata Copy of @a indata + * + * This function creates a new krb5_data object with the contents of @a indata. + * Use krb5_free_data() to free @a outdata when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_data(krb5_context context, const krb5_data *indata, krb5_data **outdata); + +/** + * Copy a principal. + * + * @param [in] context Library context + * @param [in] inprinc Principal to be copied + * @param [out] outprinc Copy of @a inprinc + * + * This function creates a new principal structure with the contents of @a + * inprinc. Use krb5_free_principal() to free @a outprinc when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_principal(krb5_context context, krb5_const_principal inprinc, + krb5_principal *outprinc); + +/** + * Copy an array of addresses. + * + * @param [in] context Library context + * @param [in] inaddr Array of addresses to be copied + * @param [out] outaddr Copy of array of addresses + * + * This function creates a new address array containing a copy of @a inaddr. + * Use krb5_free_addresses() to free @a outaddr when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_addresses(krb5_context context, krb5_address *const *inaddr, + krb5_address ***outaddr); + +/** + * Copy a krb5_ticket structure. + * + * @param [in] context Library context + * @param [in] from Ticket to be copied + * @param [out] pto Copy of ticket + * + * This function creates a new krb5_ticket structure containing the contents of + * @a from. Use krb5_free_ticket() to free @a pto when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_ticket(krb5_context context, const krb5_ticket *from, krb5_ticket **pto); + +/** + * Copy an authorization data list. + * + * @param [in] context Library context + * @param [in] in_authdat List of @a krb5_authdata structures + * @param [out] out New array of @a krb5_authdata structures + * + * This function creates a new authorization data list containing a copy of @a + * in_authdat, which must be null-terminated. Use krb5_free_authdata() to free + * @a out when it is no longer needed. + * + * @note The last array entry in @a in_authdat must be a NULL pointer. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_authdata(krb5_context context, + krb5_authdata *const *in_authdat, krb5_authdata ***out); + +/** + * Find authorization data elements. + * + * @param [in] context Library context + * @param [in] ticket_authdata Authorization data list from ticket + * @param [in] ap_req_authdata Authorization data list from AP request + * @param [in] ad_type Authorization data type to find + * @param [out] results List of matching entries + * + * This function searches @a ticket_authdata and @a ap_req_authdata for + * elements of type @a ad_type. Either input list may be NULL, in which case + * it will not be searched; otherwise, the input lists must be terminated by + * NULL entries. This function will search inside AD-IF-RELEVANT containers if + * found in either list. Use krb5_free_authdata() to free @a results when it + * is no longer needed. + * + * @version New in 1.10 + */ +krb5_error_code KRB5_CALLCONV +krb5_find_authdata(krb5_context context, krb5_authdata *const *ticket_authdata, + krb5_authdata *const *ap_req_authdata, + krb5_authdatatype ad_type, krb5_authdata ***results); + +/** + * Merge two authorization data lists into a new list. + * + * @param [in] context Library context + * @param [in] inauthdat1 First list of @a krb5_authdata structures + * @param [in] inauthdat2 Second list of @a krb5_authdata structures + * @param [out] outauthdat Merged list of @a krb5_authdata structures + * + * Merge two authdata arrays, such as the array from a ticket + * and authenticator. + * Use krb5_free_authdata() to free @a outauthdat when it is no longer needed. + * + * @note The last array entry in @a inauthdat1 and @a inauthdat2 + * must be a NULL pointer. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_merge_authdata(krb5_context context, + krb5_authdata *const *inauthdat1, + krb5_authdata * const *inauthdat2, + krb5_authdata ***outauthdat); + +/** + * Copy a krb5_authenticator structure. + * + * @param [in] context Library context + * @param [in] authfrom krb5_authenticator structure to be copied + * @param [out] authto Copy of krb5_authenticator structure + * + * This function creates a new krb5_authenticator structure with the content of + * @a authfrom. Use krb5_free_authenticator() to free @a authto when it is no + * longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom, + krb5_authenticator **authto); + +/** + * Copy a krb5_checksum structure. + * + * @param [in] context Library context + * @param [in] ckfrom Checksum to be copied + * @param [out] ckto Copy of krb5_checksum structure + * + * This function creates a new krb5_checksum structure with the contents of @a + * ckfrom. Use krb5_free_checksum() to free @a ckto when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_copy_checksum(krb5_context context, const krb5_checksum *ckfrom, + krb5_checksum **ckto); + +/** + * Generate a replay cache object for server use and open it. + * + * @param [in] context Library context + * @param [in] piece Unused (replay cache identifier) + * @param [out] rcptr Handle to an open rcache + * + * This function creates a handle to the default replay cache. Use + * krb5_rc_close() to close @a rcptr when it is no longer needed. + * + * @version Prior to release 1.18, this function creates a handle to a + * different replay cache for each unique value of @a piece. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_server_rcache(krb5_context context, const krb5_data *piece, + krb5_rcache *rcptr); + +/** + * Build a principal name using length-counted strings. + * + * @param [in] context Library context + * @param [out] princ Principal name + * @param [in] rlen Realm name length + * @param [in] realm Realm name + * @param [in] ... List of unsigned int/char * components, followed by 0 + * + * This function creates a principal from a length-counted string and a + * variable-length list of length-counted components. The list of components + * ends with the first 0 length argument (so it is not possible to specify an + * empty component with this function). Call krb5_free_principal() to free + * allocated memory for principal when it is no longer needed. + * + * Beginning with release 1.20, the name type of the principal will be inferred + * as @c KRB5_NT_SRV_INST or @c KRB5_NT_WELLKNOWN based on the principal name. + * The type will be @c KRB5_NT_PRINCIPAL if a type cannot be inferred. + * + * @code + * Example of how to build principal WELLKNOWN/ANONYMOUS@R + * krb5_build_principal_ext(context, &principal, strlen("R"), "R", + * (unsigned int)strlen(KRB5_WELLKNOWN_NAMESTR), + * KRB5_WELLKNOWN_NAMESTR, + * (unsigned int)strlen(KRB5_ANONYMOUS_PRINCSTR), + * KRB5_ANONYMOUS_PRINCSTR, 0); + * @endcode + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV_C +krb5_build_principal_ext(krb5_context context, krb5_principal * princ, + unsigned int rlen, const char * realm, ...); + +/** + * Build a principal name using null-terminated strings. + * + * @param [in] context Library context + * @param [out] princ Principal name + * @param [in] rlen Realm name length + * @param [in] realm Realm name + * @param [in] ... List of char * components, ending with NULL + * + * Call krb5_free_principal() to free @a princ when it is no longer needed. + * + * Beginning with release 1.20, the name type of the principal will be inferred + * as @c KRB5_NT_SRV_INST or @c KRB5_NT_WELLKNOWN based on the principal name. + * The type will be @c KRB5_NT_PRINCIPAL if a type cannot be inferred. + * + * @note krb5_build_principal() and krb5_build_principal_alloc_va() perform the + * same task. krb5_build_principal() takes variadic arguments. + * krb5_build_principal_alloc_va() takes a pre-computed @a varargs pointer. + * + * @code + * Example of how to build principal H/S@R + * krb5_build_principal(context, &principal, + * strlen("R"), "R", "H", "S", (char*)NULL); + * @endcode + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV_C +krb5_build_principal(krb5_context context, + krb5_principal * princ, + unsigned int rlen, + const char * realm, ...) +#if __GNUC__ >= 4 + __attribute__ ((sentinel)) +#endif + ; +#if KRB5_DEPRECATED +/** @deprecated Replaced by krb5_build_principal_alloc_va(). */ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_build_principal_va(krb5_context context, + krb5_principal princ, + unsigned int rlen, + const char *realm, + va_list ap); +#endif + +/** + * Build a principal name, using a precomputed variable argument list + * + * @param [in] context Library context + * @param [out] princ Principal structure + * @param [in] rlen Realm name length + * @param [in] realm Realm name + * @param [in] ap List of char * components, ending with NULL + * + * Similar to krb5_build_principal(), this function builds a principal name, + * but its name components are specified as a va_list. + * + * Use krb5_free_principal() to deallocate @a princ when it is no longer + * needed. + * + * @code + * Function usage example: + * va_list ap; + * va_start(ap, realm); + * krb5_build_principal_alloc_va(context, princ, rlen, realm, ap); + * va_end(ap); + * @endcode + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_build_principal_alloc_va(krb5_context context, + krb5_principal *princ, + unsigned int rlen, + const char *realm, + va_list ap); + +/** + * Convert a Kerberos V4 principal to a Kerberos V5 principal. + * + * @param [in] context Library context + * @param [in] name V4 name + * @param [in] instance V4 instance + * @param [in] realm Realm + * @param [out] princ V5 principal + * + * This function builds a @a princ from V4 specification based on given input + * @a name.instance\@realm. + * + * Use krb5_free_principal() to free @a princ when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_425_conv_principal(krb5_context context, const char *name, + const char *instance, const char *realm, + krb5_principal *princ); + +/** + * Convert a Kerberos V5 principal to a Kerberos V4 principal. + * + * @param [in] context Library context + * @param [in] princ V5 Principal + * @param [out] name V4 principal's name to be filled in + * @param [out] inst V4 principal's instance name to be filled in + * @param [out] realm Principal's realm name to be filled in + * + * This function separates a V5 principal @a princ into @a name, @a instance, + * and @a realm. + * + * @retval + * 0 Success + * @retval + * KRB5_INVALID_PRINCIPAL Invalid principal name + * @retval + * KRB5_CONFIG_CANTOPEN Can't open or find Kerberos configuration file + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_524_conv_principal(krb5_context context, krb5_const_principal princ, + char *name, char *inst, char *realm); +/** + *@deprecated + */ +struct credentials; + +/** + * Convert a Kerberos V5 credentials to a Kerberos V4 credentials + * + * @note Not implemented + * + * @retval KRB524_KRB4_DISABLED (always) + */ +int KRB5_CALLCONV +krb5_524_convert_creds(krb5_context context, krb5_creds *v5creds, + struct credentials *v4creds); + +#if KRB5_DEPRECATED +#define krb524_convert_creds_kdc krb5_524_convert_creds +#define krb524_init_ets(x) (0) +#endif + +/* libkt.spec */ + +/** + * Get a handle for a key table. + * + * @param [in] context Library context + * @param [in] name Name of the key table + * @param [out] ktid Key table handle + * + * Resolve the key table name @a name and set @a ktid to a handle identifying + * the key table. Use krb5_kt_close() to free @a ktid when it is no longer + * needed. + * + * @a name must be of the form @c type:residual, where @a type must be a type + * known to the library and @a residual portion should be specific to the + * particular keytab type. If no @a type is given, the default is @c FILE. + * + * If @a name is of type @c FILE, the keytab file is not opened by this call. + * + * @code + * Example: krb5_kt_resolve(context, "FILE:/tmp/filename", &ktid); + * @endcode + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_resolve(krb5_context context, const char *name, krb5_keytab *ktid); + +/** + * Duplicate keytab handle. + * + * @param [in] context Library context + * @param [in] in Key table handle to be duplicated + * @param [out] out Key table handle + * + * Create a new handle referring to the same key table as @a in. The new + * handle and @a in can be closed independently. + * + * @version New in 1.12 + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_dup(krb5_context context, krb5_keytab in, krb5_keytab *out); + +/** + * Get the default key table name. + * + * @param [in] context Library context + * @param [out] name Default key table name + * @param [in] name_size Space available in @a name + * + * Fill @a name with the name of the default key table for @a context. + * + * @sa MAX_KEYTAB_NAME_LEN + * + * @retval + * 0 Success + * @retval + * KRB5_CONFIG_NOTENUFSPACE Buffer is too short + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_default_name(krb5_context context, char *name, int name_size); + +/** + * Resolve the default key table. + * + * @param [in] context Library context + * @param [out] id Key table handle + * + * Set @a id to a handle to the default key table. The key table is not + * opened. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_default(krb5_context context, krb5_keytab *id); + +/** + * Resolve the default client key table. + * + * @param [in] context Library context + * @param [out] keytab_out Key table handle + * + * Fill @a keytab_out with a handle to the default client key table. + * + * @version New in 1.11 + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_client_default(krb5_context context, krb5_keytab *keytab_out); + +/** + * Free the contents of a key table entry. + * + * @param [in] context Library context + * @param [in] entry Key table entry whose contents are to be freed + * + * @note The pointer is not freed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_free_keytab_entry_contents(krb5_context context, krb5_keytab_entry *entry); + +/** @deprecated Use krb5_free_keytab_entry_contents instead. */ +krb5_error_code KRB5_CALLCONV +krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *entry); + + +/* remove and add are functions, so that they can return NOWRITE + if not a writable keytab */ + +/** + * Remove an entry from a key table. + * + * @param [in] context Library context + * @param [in] id Key table handle + * @param [in] entry Entry to remove from key table + * + * @retval + * 0 Success + * @retval + * KRB5_KT_NOWRITE Key table is not writable + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_remove_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry); + +/** + * Add a new entry to a key table. + * + * @param [in] context Library context + * @param [in] id Key table handle + * @param [in] entry Entry to be added + * + * @retval + * 0 Success + * @retval + * ENOMEM Insufficient memory + * @retval + * KRB5_KT_NOWRITE Key table is not writeable + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_add_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry); + +/** + * Convert a principal name into the default salt for that principal. + * + * @param [in] context Library context + * @param [in] pr Principal name + * @param [out] ret Default salt for @a pr to be filled in + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV_WRONG +krb5_principal2salt(krb5_context context, + krb5_const_principal pr, krb5_data *ret); +/* librc.spec--see rcache.h */ + +/* libcc.spec */ + +/** + * Resolve a credential cache name. + * + * @param [in] context Library context + * @param [in] name Credential cache name to be resolved + * @param [out] cache Credential cache handle + * + * Fills in @a cache with a @a cache handle that corresponds to the name in @a + * name. @a name should be of the form @c type:residual, and @a type must be a + * type known to the library. If the @a name does not contain a colon, + * interpret it as a file name. + * + * @code + * Example: krb5_cc_resolve(context, "MEMORY:C_", &cache); + * @endcode + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_resolve(krb5_context context, const char *name, krb5_ccache *cache); + +/** + * Duplicate ccache handle. + * + * @param [in] context Library context + * @param [in] in Credential cache handle to be duplicated + * @param [out] out Credential cache handle + * + * Create a new handle referring to the same cache as @a in. + * The new handle and @a in can be closed independently. + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out); + +/** + * Return the name of the default credential cache. + * + * @param [in] context Library context + * + * Return a pointer to the default credential cache name for @a context, as + * determined by a prior call to krb5_cc_set_default_name(), by the KRB5CCNAME + * environment variable, by the default_ccache_name profile variable, or by the + * operating system or build-time default value. The returned value must not + * be modified or freed by the caller. The returned value becomes invalid when + * @a context is destroyed krb5_free_context() or if a subsequent call to + * krb5_cc_set_default_name() is made on @a context. + * + * The default credential cache name is cached in @a context between calls to + * this function, so if the value of KRB5CCNAME changes in the process + * environment after the first call to this function on, that change will not + * be reflected in later calls with the same context. The caller can invoke + * krb5_cc_set_default_name() with a NULL value of @a name to clear the cached + * value and force the default name to be recomputed. + * + * @return + * Name of default credential cache for the current user. + */ +const char *KRB5_CALLCONV +krb5_cc_default_name(krb5_context context); + +/** + * Set the default credential cache name. + * + * @param [in] context Library context + * @param [in] name Default credential cache name or NULL + * + * Set the default credential cache name to @a name for future operations using + * @a context. If @a name is NULL, clear any previous application-set default + * name and forget any cached value of the default name for @a context. + * + * Calls to this function invalidate the result of any previous calls to + * krb5_cc_default_name() using @a context. + * + * @retval + * 0 Success + * @retval + * KV5M_CONTEXT Bad magic number for @c _krb5_context structure + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_set_default_name(krb5_context context, const char *name); + +/** + * Resolve the default credential cache name. + * + * @param [in] context Library context + * @param [out] ccache Pointer to credential cache name + * + * Create a handle to the default credential cache as given by + * krb5_cc_default_name(). + * + * @retval + * 0 Success + * @retval + * KV5M_CONTEXT Bad magic number for @c _krb5_context structure + * @retval + * KRB5_FCC_INTERNAL The name of the default credential cache cannot be + * obtained + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_default(krb5_context context, krb5_ccache *ccache); + +/** + * Copy a credential cache. + * + * @param [in] context Library context + * @param [in] incc Credential cache to be copied + * @param [out] outcc Copy of credential cache to be filled in + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_copy_creds(krb5_context context, krb5_ccache incc, krb5_ccache outcc); + +/** + * Get a configuration value from a credential cache. + * + * @param [in] context Library context + * @param [in] id Credential cache handle + * @param [in] principal Configuration for this principal; + * if NULL, global for the whole cache + * @param [in] key Name of config variable + * @param [out] data Data to be fetched + * + * Use krb5_free_data_contents() to free @a data when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_get_config(krb5_context context, krb5_ccache id, + krb5_const_principal principal, + const char *key, krb5_data *data); + +/** + * Store a configuration value in a credential cache. + * + * @param [in] context Library context + * @param [in] id Credential cache handle + * @param [in] principal Configuration for a specific principal; + * if NULL, global for the whole cache + * @param [in] key Name of config variable + * @param [in] data Data to store, or NULL to remove + * + * @note Existing configuration under the same key is over-written. + * + * @warning Before version 1.10 @a data was assumed to be always non-null. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_set_config(krb5_context context, krb5_ccache id, + krb5_const_principal principal, + const char *key, krb5_data *data); + +/** + * Test whether a principal is a configuration principal. + * + * @param [in] context Library context + * @param [in] principal Principal to check + * + * @return + * @c TRUE if the principal is a configuration principal (generated part of + * krb5_cc_set_config()); @c FALSE otherwise. + */ +krb5_boolean KRB5_CALLCONV +krb5_is_config_principal(krb5_context context, krb5_const_principal principal); + +/** + * Make a credential cache the primary cache for its collection. + * + * @param [in] context Library context + * @param [in] cache Credential cache handle + * + * If the type of @a cache supports it, set @a cache to be the primary + * credential cache for the collection it belongs to. + * + * @retval + * 0 Success, or the type of @a cache doesn't support switching + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_switch(krb5_context context, krb5_ccache cache); + +/** + * Determine whether a credential cache type supports switching. + * + * @param [in] context Library context + * @param [in] type Credential cache type + * + * @version New in 1.10 + * + * @retval TRUE if @a type supports switching + * @retval FALSE if it does not or is not a valid credential cache type. + */ +krb5_boolean KRB5_CALLCONV +krb5_cc_support_switch(krb5_context context, const char *type); + +/** + * Find a credential cache with a specified client principal. + * + * @param [in] context Library context + * @param [in] client Client principal + * @param [out] cache_out Credential cache handle + * + * Find a cache within the collection whose default principal is @a client. + * Use @a krb5_cc_close to close @a ccache when it is no longer needed. + * + * @retval 0 Success + * @retval KRB5_CC_NOTFOUND + * + * @sa krb5_cccol_cursor_new + * + * @version New in 1.10 + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_cache_match(krb5_context context, krb5_principal client, + krb5_ccache *cache_out); + +/** + * Select a credential cache to use with a server principal. + * + * @param [in] context Library context + * @param [in] server Server principal + * @param [out] cache_out Credential cache handle + * @param [out] princ_out Client principal + * + * Select a cache within the collection containing credentials most appropriate + * for use with @a server, according to configured rules and heuristics. + * + * Use krb5_cc_close() to release @a cache_out when it is no longer needed. + * Use krb5_free_principal() to release @a princ_out when it is no longer + * needed. Note that @a princ_out is set in some error conditions. + * + * @return + * If an appropriate cache is found, 0 is returned, @a cache_out is set to the + * selected cache, and @a princ_out is set to the default principal of that + * cache. + * + * If the appropriate client principal can be authoritatively determined but + * the cache collection contains no credentials for that principal, then + * KRB5_CC_NOTFOUND is returned, @a cache_out is set to NULL, and @a princ_out + * is set to the appropriate client principal. + * + * If no configured mechanism can determine the appropriate cache or principal, + * KRB5_CC_NOTFOUND is returned and @a cache_out and @a princ_out are set to + * NULL. + * + * Any other error code indicates a fatal error in the processing of a cache + * selection mechanism. + * + * @version New in 1.10 + */ +krb5_error_code KRB5_CALLCONV +krb5_cc_select(krb5_context context, krb5_principal server, + krb5_ccache *cache_out, krb5_principal *princ_out); + +/* krb5_free.c */ +/** + * Free the storage assigned to a principal. + * + * @param [in] context Library context + * @param [in] val Principal to be freed + */ +void KRB5_CALLCONV +krb5_free_principal(krb5_context context, krb5_principal val); + +/** + * Free a krb5_authenticator structure. + * + * @param [in] context Library context + * @param [in] val Authenticator structure to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_authenticator(krb5_context context, krb5_authenticator *val); + +/** + * Free the data stored in array of addresses. + * + * @param [in] context Library context + * @param [in] val Array of addresses to be freed + * + * This function frees the contents of @a val and the array itself. + * + * @note The last entry in the array must be a NULL pointer. + */ +void KRB5_CALLCONV +krb5_free_addresses(krb5_context context, krb5_address **val); + +/** + * Free the storage assigned to array of authentication data. + * + * @param [in] context Library context + * @param [in] val Array of authentication data to be freed + * + * This function frees the contents of @a val and the array itself. + * + * @note The last entry in the array must be a NULL pointer. + */ +void KRB5_CALLCONV +krb5_free_authdata(krb5_context context, krb5_authdata **val); + +/** + * Free a ticket. + * + * @param [in] context Library context + * @param [in] val Ticket to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_ticket(krb5_context context, krb5_ticket *val); + +/** + * Free an error allocated by krb5_read_error() or krb5_sendauth(). + * + * @param [in] context Library context + * @param [in] val Error data structure to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_error(krb5_context context, krb5_error *val); + +/** + * Free a krb5_creds structure. + * + * @param [in] context Library context + * @param [in] val Credential structure to be freed. + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_creds(krb5_context context, krb5_creds *val); + +/** + * Free the contents of a krb5_creds structure. + * + * @param [in] context Library context + * @param [in] val Credential structure to free contents of + * + * This function frees the contents of @a val, but not the structure itself. + */ +void KRB5_CALLCONV +krb5_free_cred_contents(krb5_context context, krb5_creds *val); + +/** + * Free a krb5_checksum structure. + * + * @param [in] context Library context + * @param [in] val Checksum structure to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_checksum(krb5_context context, krb5_checksum *val); + +/** + * Free the contents of a krb5_checksum structure. + * + * @param [in] context Library context + * @param [in] val Checksum structure to free contents of + * + * This function frees the contents of @a val, but not the structure itself. + * It sets the checksum's data pointer to null and (beginning in release 1.19) + * sets its length to zero. + */ +void KRB5_CALLCONV +krb5_free_checksum_contents(krb5_context context, krb5_checksum *val); + +/** + * Free a krb5_keyblock structure. + * + * @param [in] context Library context + * @param [in] val Keyblock to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_keyblock(krb5_context context, krb5_keyblock *val); + +/** + * Free the contents of a krb5_keyblock structure. + * + * @param [in] context Library context + * @param [in] key Keyblock to be freed + * + * This function frees the contents of @a key, but not the structure itself. + */ +void KRB5_CALLCONV +krb5_free_keyblock_contents(krb5_context context, krb5_keyblock *key); + +/** + * Free a krb5_ap_rep_enc_part structure. + * + * @param [in] context Library context + * @param [in] val AP-REP enc part to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_ap_rep_enc_part(krb5_context context, krb5_ap_rep_enc_part *val); + +/** + * Free a krb5_data structure. + * + * @param [in] context Library context + * @param [in] val Data structure to be freed + * + * This function frees the contents of @a val and the structure itself. + */ +void KRB5_CALLCONV +krb5_free_data(krb5_context context, krb5_data *val); + +/* Free a krb5_octet_data structure (should be unused). */ +void KRB5_CALLCONV +krb5_free_octet_data(krb5_context context, krb5_octet_data *val); + +/** + * Free the contents of a krb5_data structure and zero the data field. + * + * @param [in] context Library context + * @param [in] val Data structure to free contents of + * + * This function frees the contents of @a val, but not the structure itself. + * It sets the structure's data pointer to null and (beginning in release 1.19) + * sets its length to zero. + */ +void KRB5_CALLCONV +krb5_free_data_contents(krb5_context context, krb5_data *val); + +/** + * Free a string representation of a principal. + * + * @param [in] context Library context + * @param [in] val Name string to be freed + */ +void KRB5_CALLCONV +krb5_free_unparsed_name(krb5_context context, char *val); + +/** + * Free a string allocated by a krb5 function. + * + * @param [in] context Library context + * @param [in] val String to be freed + * + * @version New in 1.10 + */ +void KRB5_CALLCONV +krb5_free_string(krb5_context context, char *val); + +/** + * Free an array of encryption types. + * + * @param [in] context Library context + * @param [in] val Array of enctypes to be freed + * + * @version New in 1.12 + */ +void KRB5_CALLCONV +krb5_free_enctypes(krb5_context context, krb5_enctype *val); + +/** + * Free an array of checksum types. + * + * @param [in] context Library context + * @param [in] val Array of checksum types to be freed + */ +void KRB5_CALLCONV +krb5_free_cksumtypes(krb5_context context, krb5_cksumtype *val); + +/* From krb5/os, but needed by the outside world */ +/** + * Retrieve the system time of day, in sec and ms, since the epoch. + * + * @param [in] context Library context + * @param [out] seconds System timeofday, seconds portion + * @param [out] microseconds System timeofday, microseconds portion + * + * This function retrieves the system time of day with the context + * specific time offset adjustment. + * + * @sa krb5_crypto_us_timeofday() + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_us_timeofday(krb5_context context, + krb5_timestamp *seconds, krb5_int32 *microseconds); + +/** + * Retrieve the current time with context specific time offset adjustment. + * + * @param [in] context Library context + * @param [out] timeret Timestamp to fill in + * + * This function retrieves the system time of day with the context specific + * time offset adjustment. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_timeofday(krb5_context context, krb5_timestamp *timeret); + +/** + * Check if a timestamp is within the allowed clock skew of the current time. + * + * @param [in] context Library context + * @param [in] date Timestamp to check + * + * This function checks if @a date is close enough to the current time + * according to the configured allowable clock skew. + * + * @version New in 1.10 + * + * @retval 0 Success + * @retval KRB5KRB_AP_ERR_SKEW @a date is not within allowable clock skew + */ +krb5_error_code KRB5_CALLCONV +krb5_check_clockskew(krb5_context context, krb5_timestamp date); + +/** + * Return all interface addresses for this host. + * + * @param [in] context Library context + * @param [out] addr Array of krb5_address pointers, ending with + * NULL + * + * Use krb5_free_addresses() to free @a addr when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_os_localaddr(krb5_context context, krb5_address ***addr); + +/** + * Retrieve the default realm. + * + * @param [in] context Library context + * @param [out] lrealm Default realm name + * + * Retrieves the default realm to be used if no user-specified realm is + * available. + * + * Use krb5_free_default_realm() to free @a lrealm when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_default_realm(krb5_context context, char **lrealm); + +/** + * Override the default realm for the specified context. + * + * @param [in] context Library context + * @param [in] lrealm Realm name for the default realm + * + * If @a lrealm is NULL, clear the default realm setting. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_set_default_realm(krb5_context context, const char *lrealm); + +/** + * Free a default realm string returned by krb5_get_default_realm(). + * + * @param [in] context Library context + * @param [in] lrealm Realm to be freed + */ +void KRB5_CALLCONV +krb5_free_default_realm(krb5_context context, char *lrealm); + +/** + * Canonicalize a hostname, possibly using name service. + * + * @param [in] context Library context + * @param [in] host Input hostname + * @param [out] canonhost_out Canonicalized hostname + * + * This function canonicalizes orig_hostname, possibly using name service + * lookups if configuration permits. Use krb5_free_string() to free @a + * canonhost_out when it is no longer needed. + * + * @version New in 1.15 + */ +krb5_error_code KRB5_CALLCONV +krb5_expand_hostname(krb5_context context, const char *host, + char **canonhost_out); + +/** + * Generate a full principal name from a service name. + * + * @param [in] context Library context + * @param [in] hostname Host name, or NULL to use local host + * @param [in] sname Service name, or NULL to use @c "host" + * @param [in] type Principal type + * @param [out] ret_princ Generated principal + * + * This function converts a @a hostname and @a sname into @a krb5_principal + * structure @a ret_princ. The returned principal will be of the form @a + * sname\/hostname\@REALM where REALM is determined by krb5_get_host_realm(). + * In some cases this may be the referral (empty) realm. + * + * The @a type can be one of the following: + * + * @li #KRB5_NT_SRV_HST canonicalizes the host name before looking up the + * realm and generating the principal. + * + * @li #KRB5_NT_UNKNOWN accepts the hostname as given, and does not + * canonicalize it. + * + * Use krb5_free_principal to free @a ret_princ when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_sname_to_principal(krb5_context context, const char *hostname, const char *sname, + krb5_int32 type, krb5_principal *ret_princ); + +/** + * Test whether a principal matches a matching principal. + * + * @param [in] context Library context + * @param [in] matching Matching principal + * @param [in] princ Principal to test + * + * @note A matching principal is a host-based principal with an empty realm + * and/or second data component (hostname). Profile configuration may cause + * the hostname to be ignored even if it is present. A principal matches a + * matching principal if the former has the same non-empty (and non-ignored) + * components of the latter. + * + * If @a matching is NULL, return TRUE. If @a matching is not a matching + * principal, return the value of krb5_principal_compare(context, matching, + * princ). + * + * @return + * TRUE if @a princ matches @a matching, FALSE otherwise. + */ +krb5_boolean KRB5_CALLCONV +krb5_sname_match(krb5_context context, krb5_const_principal matching, + krb5_const_principal princ); + +/** + * Change a password for an existing Kerberos account. + * + * @param [in] context Library context + * @param [in] creds Credentials for kadmin/changepw service + * @param [in] newpw New password + * @param [out] result_code Numeric error code from server + * @param [out] result_code_string String equivalent to @a result_code + * @param [out] result_string Change password response from the KDC + * + * Change the password for the existing principal identified by @a creds. + * + * The possible values of the output @a result_code are: + * + * @li #KRB5_KPASSWD_SUCCESS (0) - success + * @li #KRB5_KPASSWD_MALFORMED (1) - Malformed request error + * @li #KRB5_KPASSWD_HARDERROR (2) - Server error + * @li #KRB5_KPASSWD_AUTHERROR (3) - Authentication error + * @li #KRB5_KPASSWD_SOFTERROR (4) - Password change rejected + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_change_password(krb5_context context, krb5_creds *creds, + const char *newpw, int *result_code, + krb5_data *result_code_string, krb5_data *result_string); + +/** + * Set a password for a principal using specified credentials. + * + * @param [in] context Library context + * @param [in] creds Credentials for kadmin/changepw service + * @param [in] newpw New password + * @param [in] change_password_for Change the password for this principal + * @param [out] result_code Numeric error code from server + * @param [out] result_code_string String equivalent to @a result_code + * @param [out] result_string Data returned from the remote system + * + * This function uses the credentials @a creds to set the password @a newpw for + * the principal @a change_password_for. It implements the set password + * operation of RFC 3244, for interoperability with Microsoft Windows + * implementations. + * + * @note If @a change_password_for is NULL, the change is performed on the + * current principal. If @a change_password_for is non-null, the change is + * performed on the principal name passed in @a change_password_for. + * + * The error code and strings are returned in @a result_code, + * @a result_code_string and @a result_string. + * + * @sa krb5_set_password_using_ccache() + * + * @retval + * 0 Success and result_code is set to #KRB5_KPASSWD_SUCCESS. + * @return + * Kerberos error codes. + */ +krb5_error_code KRB5_CALLCONV +krb5_set_password(krb5_context context, krb5_creds *creds, const char *newpw, + krb5_principal change_password_for, int *result_code, + krb5_data *result_code_string, krb5_data *result_string); + +/** + * Set a password for a principal using cached credentials. + * + * @param [in] context Library context + * @param [in] ccache Credential cache + * @param [in] newpw New password + * @param [in] change_password_for Change the password for this principal + * @param [out] result_code Numeric error code from server + * @param [out] result_code_string String equivalent to @a result_code + * @param [out] result_string Data returned from the remote system + * + * This function uses the cached credentials from @a ccache to set the password + * @a newpw for the principal @a change_password_for. It implements RFC 3244 + * set password operation (interoperable with MS Windows implementations) using + * the credential cache. + * + * The error code and strings are returned in @a result_code, + * @a result_code_string and @a result_string. + * + * @note If @a change_password_for is set to NULL, the change is performed on + * the default principal in @a ccache. If @a change_password_for is non null, + * the change is performed on the specified principal. + * + * @sa krb5_set_password() + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_set_password_using_ccache(krb5_context context, krb5_ccache ccache, + const char *newpw, + krb5_principal change_password_for, + int *result_code, krb5_data *result_code_string, + krb5_data *result_string); + +/** + * Get a result message for changing or setting a password. + * + * @param [in] context Library context + * @param [in] server_string Data returned from the remote system + * @param [out] message_out A message displayable to the user + * + * This function processes the @a server_string returned in the @a + * result_string parameter of krb5_change_password(), krb5_set_password(), and + * related functions, and returns a displayable string. If @a server_string + * contains Active Directory structured policy information, it will be + * converted into human-readable text. + * + * Use krb5_free_string() to free @a message_out when it is no longer needed. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_chpw_message(krb5_context context, const krb5_data *server_string, + char **message_out); + +/** + * Retrieve configuration profile from the context. + * + * @param [in] context Library context + * @param [out] profile Pointer to data read from a configuration file + * + * This function creates a new @a profile object that reflects profile + * in the supplied @a context. + * + * The @a profile object may be freed with profile_release() function. + * See profile.h and profile API for more details. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_profile(krb5_context context, struct _profile_t ** profile); + +#if KRB5_DEPRECATED +/** @deprecated Replaced by krb5_get_init_creds_password().*/ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_get_in_tkt_with_password(krb5_context context, krb5_flags options, + krb5_address *const *addrs, krb5_enctype *ktypes, + krb5_preauthtype *pre_auth_types, + const char *password, krb5_ccache ccache, + krb5_creds *creds, krb5_kdc_rep **ret_as_reply); + +/** @deprecated Replaced by krb5_get_init_creds(). */ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_get_in_tkt_with_skey(krb5_context context, krb5_flags options, + krb5_address *const *addrs, krb5_enctype *ktypes, + krb5_preauthtype *pre_auth_types, + const krb5_keyblock *key, krb5_ccache ccache, + krb5_creds *creds, krb5_kdc_rep **ret_as_reply); + +/** @deprecated Replaced by krb5_get_init_creds_keytab(). */ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options, + krb5_address *const *addrs, krb5_enctype *ktypes, + krb5_preauthtype *pre_auth_types, + krb5_keytab arg_keytab, krb5_ccache ccache, + krb5_creds *creds, krb5_kdc_rep **ret_as_reply); + +#endif /* KRB5_DEPRECATED */ + +/** + * Parse and decrypt a @c KRB_AP_REQ message. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] inbuf AP-REQ message to be parsed + * @param [in] server Matching principal for server, or NULL to + * allow any principal in keytab + * @param [in] keytab Key table, or NULL to use the default + * @param [out] ap_req_options If non-null, the AP-REQ flags on output + * @param [out] ticket If non-null, ticket from the AP-REQ message + * + * This function parses, decrypts and verifies a AP-REQ message from @a inbuf + * and stores the authenticator in @a auth_context. + * + * If a keyblock was specified in @a auth_context using + * krb5_auth_con_setuseruserkey(), that key is used to decrypt the ticket in + * AP-REQ message and @a keytab is ignored. In this case, @a server should be + * specified as a complete principal name to allow for proper transited-path + * checking and replay cache selection. + * + * Otherwise, the decryption key is obtained from @a keytab, or from the + * default keytab if it is NULL. In this case, @a server may be a complete + * principal name, a matching principal (see krb5_sname_match()), or NULL to + * match any principal name. The keys tried against the encrypted part of the + * ticket are determined as follows: + * + * - If @a server is a complete principal name, then its entry in @a keytab is + * tried. + * - Otherwise, if @a keytab is iterable, then all entries in @a keytab which + * match @a server are tried. + * - Otherwise, the server principal in the ticket must match @a server, and + * its entry in @a keytab is tried. + * + * The client specified in the decrypted authenticator must match the client + * specified in the decrypted ticket. + * + * If the @a remote_addr field of @a auth_context is set, the request must come + * from that address. + * + * If a replay cache handle is provided in the @a auth_context, the + * authenticator and ticket are verified against it. If no conflict is found, + * the new authenticator is then stored in the replay cache of @a auth_context. + * + * Various other checks are performed on the decoded data, including + * cross-realm policy, clockskew, and ticket validation times. + * + * On success the authenticator, subkey, and remote sequence number of the + * request are stored in @a auth_context. If the #AP_OPTS_MUTUAL_REQUIRED + * bit is set, the local sequence number is XORed with the remote sequence + * number in the request. + * + * Use krb5_free_ticket() to free @a ticket when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_req(krb5_context context, krb5_auth_context *auth_context, + const krb5_data *inbuf, krb5_const_principal server, + krb5_keytab keytab, krb5_flags *ap_req_options, + krb5_ticket **ticket); + +/** + * Retrieve a service key from a key table. + * + * @param [in] context Library context + * @param [in] keyprocarg Name of a key table (NULL to use default name) + * @param [in] principal Service principal + * @param [in] vno Key version number (0 for highest available) + * @param [in] enctype Encryption type (0 for any type) + * @param [out] key Service key from key table + * + * Open and search the specified key table for the entry identified by @a + * principal, @a enctype, and @a vno. If no key is found, return an error code. + * + * The default key table is used, unless @a keyprocarg is non-null. + * @a keyprocarg designates a specific key table. + * + * Use krb5_free_keyblock() to free @a key when it is no longer needed. + * + * @retval + * 0 Success + * @return Kerberos error code if not found or @a keyprocarg is invalid. + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_read_service_key(krb5_context context, krb5_pointer keyprocarg, + krb5_principal principal, krb5_kvno vno, + krb5_enctype enctype, krb5_keyblock **key); + +/** + * Format a @c KRB-SAFE message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] userdata User data in the message + * @param [out] der_out Formatted @c KRB-SAFE buffer + * @param [out] rdata_out Replay data. Specify NULL if not needed + * + * This function creates an integrity protected @c KRB-SAFE message + * using data supplied by the application. + * + * Fields in @a auth_context specify the checksum type, the keyblock that + * can be used to seed the checksum, full addresses (host and port) for + * the sender and receiver, and KRB5_AUTH_CONTEXT flags. + * + * The local address in @a auth_context must be set, and is used to form the + * sender address used in the KRB-SAFE message. The remote address is + * optional; if specified, it will be used to form the receiver address used in + * the message. + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context. + * + * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, a + * timestamp is included in the KRB-SAFE message, and an entry for the message + * is entered in an in-memory replay cache to detect if the message is + * reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not set, no + * replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a + * auth_context, a timestamp is included in the KRB-SAFE message and is stored + * in @a rdata_out. + * + * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the @a auth_context local sequence number is included in the + * KRB-SAFE message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the sequence number used is stored in @a rdata_out. + * + * Use krb5_free_data_contents() to free @a der_out when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_safe(krb5_context context, krb5_auth_context auth_context, + const krb5_data *userdata, krb5_data *der_out, + krb5_replay_data *rdata_out); + +/** + * Format a @c KRB-PRIV message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] userdata User data for @c KRB-PRIV message + * @param [out] der_out Formatted @c KRB-PRIV message + * @param [out] rdata_out Replay data (NULL if not needed) + * + * This function is similar to krb5_mk_safe(), but the message is encrypted and + * integrity-protected, not just integrity-protected. + * + * The local address in @a auth_context must be set, and is used to form the + * sender address used in the KRB-PRIV message. The remote address is + * optional; if specified, it will be used to form the receiver address used in + * the message. + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context. + * + * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, a + * timestamp is included in the KRB-PRIV message, and an entry for the message + * is entered in an in-memory replay cache to detect if the message is + * reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not set, no + * replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a + * auth_context, a timestamp is included in the KRB-PRIV message and is stored + * in @a rdata_out. + * + * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the @a auth_context local sequence number is included in the + * KRB-PRIV message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the sequence number used is stored in @a rdata_out. + * + * Use krb5_free_data_contents() to free @a der_out when it is no longer + * needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_priv(krb5_context context, krb5_auth_context auth_context, + const krb5_data *userdata, krb5_data *der_out, + krb5_replay_data *rdata_out); + +/** + * Client function for @c sendauth protocol. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] fd File descriptor that describes network socket + * @param [in] appl_version Application protocol version to be matched + * with the receiver's application version + * @param [in] client Client principal + * @param [in] server Server principal + * @param [in] ap_req_options Options (see AP_OPTS macros) + * @param [in] in_data Data to be sent to the server + * @param [in] in_creds Input credentials, or NULL to use @a ccache + * @param [in] ccache Credential cache + * @param [out] error If non-null, contains KRB_ERROR message + * returned from server + * @param [out] rep_result If non-null and @a ap_req_options is + * #AP_OPTS_MUTUAL_REQUIRED, contains the result + * of mutual authentication exchange + * @param [out] out_creds If non-null, the retrieved credentials + * + * This function performs the client side of a sendauth/recvauth exchange by + * sending and receiving messages over @a fd. + * + * Credentials may be specified in three ways: + * + * @li If @a in_creds is NULL, credentials are obtained with + * krb5_get_credentials() using the principals @a client and @a server. @a + * server must be non-null; @a client may NULL to use the default principal of + * @a ccache. + * + * @li If @a in_creds is non-null, but does not contain a ticket, credentials + * for the exchange are obtained with krb5_get_credentials() using @a in_creds. + * In this case, the values of @a client and @a server are unused. + * + * @li If @a in_creds is a complete credentials structure, it used directly. + * In this case, the values of @a client, @a server, and @a ccache are unused. + * + * If the server is using a different application protocol than that specified + * in @a appl_version, an error will be returned. + * + * Use krb5_free_creds() to free @a out_creds, krb5_free_ap_rep_enc_part() to + * free @a rep_result, and krb5_free_error() to free @a error when they are no + * longer needed. + * + * @sa krb5_recvauth() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, + krb5_pointer fd, char *appl_version, krb5_principal client, + krb5_principal server, krb5_flags ap_req_options, + krb5_data *in_data, krb5_creds *in_creds, krb5_ccache ccache, + krb5_error **error, krb5_ap_rep_enc_part **rep_result, + krb5_creds **out_creds); + +/** + * Server function for @a sendauth protocol. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] fd File descriptor + * @param [in] appl_version Application protocol version to be matched + * against the client's application version + * @param [in] server Server principal (NULL for any in @a keytab) + * @param [in] flags Additional specifications + * @param [in] keytab Key table containing service keys + * @param [out] ticket Ticket (NULL if not needed) + * + * This function performs the server side of a sendauth/recvauth exchange by + * sending and receiving messages over @a fd. + * + * Use krb5_free_ticket() to free @a ticket when it is no longer needed. + * + * @sa krb5_sendauth() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_recvauth(krb5_context context, krb5_auth_context *auth_context, + krb5_pointer fd, char *appl_version, krb5_principal server, + krb5_int32 flags, krb5_keytab keytab, krb5_ticket **ticket); + +/** + * Server function for @a sendauth protocol with version parameter. + * + * @param [in] context Library context + * @param [in,out] auth_context Pre-existing or newly created auth context + * @param [in] fd File descriptor + * @param [in] server Server principal (NULL for any in @a keytab) + * @param [in] flags Additional specifications + * @param [in] keytab Decryption key + * @param [out] ticket Ticket (NULL if not needed) + * @param [out] version sendauth protocol version (NULL if not needed) + * + * This function is similar to krb5_recvauth() with the additional output + * information place into @a version. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_recvauth_version(krb5_context context, + krb5_auth_context *auth_context, + krb5_pointer fd, + krb5_principal server, + krb5_int32 flags, + krb5_keytab keytab, + krb5_ticket **ticket, + krb5_data *version); + +/** + * Format a @c KRB-CRED message for an array of credentials. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] creds Null-terminated array of credentials + * @param [out] der_out Encoded credentials + * @param [out] rdata_out Replay cache information (NULL if not needed) + * + * This function takes an array of credentials @a creds and formats + * a @c KRB-CRED message @a der_out to pass to krb5_rd_cred(). + * + * The local and remote addresses in @a auth_context are optional; if either is + * specified, they are used to form the sender and receiver addresses in the + * KRB-CRED message. + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context. + * + * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, an entry + * for the message is entered in an in-memory replay cache to detect if the + * message is reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not + * set, no replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a + * auth_context, the timestamp used for the KRB-CRED message is stored in @a + * rdata_out. + * + * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the @a auth_context local sequence number is included in the + * KRB-CRED message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE + * is set, the sequence number used is stored in @a rdata_out. + * + * Use krb5_free_data_contents() to free @a der_out when it is no longer + * needed. + * + * The message will be encrypted using the send subkey of @a auth_context if it + * is present, or the session key otherwise. If neither key is present, the + * credentials will not be encrypted, and the message should only be sent over + * a secure channel. No replay cache entry is used in this case. + * + * @retval + * 0 Success + * @retval + * ENOMEM Insufficient memory + * @retval + * KRB5_RC_REQUIRED Message replay detection requires @a rcache parameter + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_ncred(krb5_context context, krb5_auth_context auth_context, + krb5_creds **creds, krb5_data **der_out, + krb5_replay_data *rdata_out); + +/** + * Format a @c KRB-CRED message for a single set of credentials. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] creds Pointer to credentials + * @param [out] der_out Encoded credentials + * @param [out] rdata_out Replay cache data (NULL if not needed) + * + * This is a convenience function that calls krb5_mk_ncred() with a single set + * of credentials. + * + * @retval + * 0 Success + * @retval + * ENOMEM Insufficient memory + * @retval + * KRB5_RC_REQUIRED Message replay detection requires @a rcache parameter + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_mk_1cred(krb5_context context, krb5_auth_context auth_context, + krb5_creds *creds, krb5_data **der_out, + krb5_replay_data *rdata_out); + +/** + * Read and validate a @c KRB-CRED message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] creddata @c KRB-CRED message + * @param [out] creds_out Null-terminated array of forwarded credentials + * @param [out] rdata_out Replay data (NULL if not needed) + * + * @note The @a rdata_out argument is required if the + * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set + * in @a auth_context.` + * + * @a creddata will be decrypted using the receiving subkey if it is present in + * @a auth_context, or the session key if the receiving subkey is not present + * or fails to decrypt the message. + * + * Use krb5_free_tgt_creds() to free @a creds_out when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_rd_cred(krb5_context context, krb5_auth_context auth_context, + krb5_data *creddata, krb5_creds ***creds_out, + krb5_replay_data *rdata_out); + +/** + * Get a forwarded TGT and format a @c KRB-CRED message. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] rhost Remote host + * @param [in] client Client principal of TGT + * @param [in] server Principal of server to receive TGT + * @param [in] cc Credential cache handle (NULL to use default) + * @param [in] forwardable Whether TGT should be forwardable + * @param [out] outbuf KRB-CRED message + * + * Get a TGT for use at the remote host @a rhost and format it into a KRB-CRED + * message. If @a rhost is NULL and @a server is of type #KRB5_NT_SRV_HST, + * the second component of @a server will be used. + * + * @retval + * 0 Success + * @retval + * ENOMEM Insufficient memory + * @retval + * KRB5_PRINC_NOMATCH Requested principal and ticket do not match + * @retval + * KRB5_NO_TKT_SUPPLIED Request did not supply a ticket + * @retval + * KRB5_CC_BADNAME Credential cache name or principal name malformed + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_fwd_tgt_creds(krb5_context context, krb5_auth_context auth_context, + const char *rhost, krb5_principal client, + krb5_principal server, krb5_ccache cc, int forwardable, + krb5_data *outbuf); + +/** + * Create and initialize an authentication context. + * + * @param [in] context Library context + * @param [out] auth_context Authentication context + * + * This function creates an authentication context to hold configuration and + * state relevant to krb5 functions for authenticating principals and + * protecting messages once authentication has occurred. + * + * By default, flags for the context are set to enable the use of the replay + * cache (#KRB5_AUTH_CONTEXT_DO_TIME), but not sequence numbers. Use + * krb5_auth_con_setflags() to change the flags. + * + * The allocated @a auth_context must be freed with krb5_auth_con_free() when + * it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_init(krb5_context context, krb5_auth_context *auth_context); + +/** + * Free a krb5_auth_context structure. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context to be freed + * + * This function frees an auth context allocated by krb5_auth_con_init(). + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context); + +/** + * Set a flags field in a krb5_auth_context structure. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] flags Flags bit mask + * + * Valid values for @a flags are: + * @li #KRB5_AUTH_CONTEXT_DO_TIME Use timestamps + * @li #KRB5_AUTH_CONTEXT_RET_TIME Save timestamps + * @li #KRB5_AUTH_CONTEXT_DO_SEQUENCE Use sequence numbers + * @li #KRB5_AUTH_CONTEXT_RET_SEQUENCE Save sequence numbers + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setflags(krb5_context context, krb5_auth_context auth_context, krb5_int32 flags); + +/** + * Retrieve flags from a krb5_auth_context structure. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] flags Flags bit mask + * + * Valid values for @a flags are: + * @li #KRB5_AUTH_CONTEXT_DO_TIME Use timestamps + * @li #KRB5_AUTH_CONTEXT_RET_TIME Save timestamps + * @li #KRB5_AUTH_CONTEXT_DO_SEQUENCE Use sequence numbers + * @li #KRB5_AUTH_CONTEXT_RET_SEQUENCE Save sequence numbers + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getflags(krb5_context context, krb5_auth_context auth_context, + krb5_int32 *flags); + +/** + * Set a checksum callback in an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] func Checksum callback + * @param [in] data Callback argument + * + * Set a callback to obtain checksum data in krb5_mk_req(). The callback will + * be invoked after the subkey and local sequence number are stored in @a + * auth_context. + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_set_checksum_func( krb5_context context, + krb5_auth_context auth_context, + krb5_mk_req_checksum_func func, + void *data); + +/** + * Get the checksum callback from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] func Checksum callback + * @param [out] data Callback argument + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_get_checksum_func( krb5_context context, + krb5_auth_context auth_context, + krb5_mk_req_checksum_func *func, + void **data); + +/** + * Set the local and remote addresses in an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] local_addr Local address + * @param [in] remote_addr Remote address + * + * This function releases the storage assigned to the contents of the local and + * remote addresses of @a auth_context and then sets them to @a local_addr and + * @a remote_addr respectively. + * + * @sa krb5_auth_con_genaddrs() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV_WRONG +krb5_auth_con_setaddrs(krb5_context context, krb5_auth_context auth_context, + krb5_address *local_addr, krb5_address *remote_addr); + +/** + * Retrieve address fields from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] local_addr Local address (NULL if not needed) + * @param [out] remote_addr Remote address (NULL if not needed) + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getaddrs(krb5_context context, krb5_auth_context auth_context, + krb5_address **local_addr, krb5_address **remote_addr); + +/** + * Set local and remote port fields in an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] local_port Local port + * @param [in] remote_port Remote port + * + * This function releases the storage assigned to the contents of the local and + * remote ports of @a auth_context and then sets them to @a local_port and @a + * remote_port respectively. + * + * @sa krb5_auth_con_genaddrs() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setports(krb5_context context, krb5_auth_context auth_context, + krb5_address *local_port, krb5_address *remote_port); + +/** + * Set the session key in an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] keyblock User key + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, + krb5_keyblock *keyblock); + +/** + * Retrieve the session key from an auth context as a keyblock. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] keyblock Session key + * + * This function creates a keyblock containing the session key from @a + * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no + * longer needed + * + * @retval 0 Success. Otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getkey(krb5_context context, krb5_auth_context auth_context, + krb5_keyblock **keyblock); + +/** + * Retrieve the session key from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] key Session key + * + * This function sets @a key to the session key from @a auth_context. Use + * krb5_k_free_key() to release @a key when it is no longer needed. + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getkey_k(krb5_context context, krb5_auth_context auth_context, + krb5_key *key); + +/** + * Retrieve the send subkey from an auth context as a keyblock. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [out] keyblock Send subkey + * + * This function creates a keyblock containing the send subkey from @a + * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no + * longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getsendsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock **keyblock); + +/** + * Retrieve the send subkey from an auth context. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [out] key Send subkey + * + * This function sets @a key to the send subkey from @a auth_context. Use + * krb5_k_free_key() to release @a key when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getsendsubkey_k(krb5_context ctx, krb5_auth_context ac, + krb5_key *key); + +/** + * Retrieve the receiving subkey from an auth context as a keyblock. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [out] keyblock Receiving subkey + * + * This function creates a keyblock containing the receiving subkey from @a + * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no + * longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getrecvsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock **keyblock); + +/** + * Retrieve the receiving subkey from an auth context as a keyblock. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [out] key Receiving subkey + * + * This function sets @a key to the receiving subkey from @a auth_context. Use + * krb5_k_free_key() to release @a key when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getrecvsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key *key); + +/** + * Set the send subkey in an auth context with a keyblock. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [in] keyblock Send subkey + * + * This function sets the send subkey in @a ac to a copy of @a keyblock. + * + * @retval 0 Success. Otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setsendsubkey(krb5_context ctx, krb5_auth_context ac, + krb5_keyblock *keyblock); + +/** + * Set the send subkey in an auth context. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [out] key Send subkey + * + * This function sets the send subkey in @a ac to @a key, incrementing its + * reference count. + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setsendsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key key); + +/** + * Set the receiving subkey in an auth context with a keyblock. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [in] keyblock Receiving subkey + * + * This function sets the receiving subkey in @a ac to a copy of @a keyblock. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setrecvsubkey(krb5_context ctx, krb5_auth_context ac, + krb5_keyblock *keyblock); + +/** + * Set the receiving subkey in an auth context. + * + * @param [in] ctx Library context + * @param [in] ac Authentication context + * @param [in] key Receiving subkey + * + * This function sets the receiving subkey in @a ac to @a key, incrementing its + * reference count. + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setrecvsubkey_k(krb5_context ctx, krb5_auth_context ac, + krb5_key key); + +#if KRB5_DEPRECATED +/** @deprecated Replaced by krb5_auth_con_getsendsubkey(). */ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_auth_con_getlocalsubkey(krb5_context context, krb5_auth_context auth_context, + krb5_keyblock **keyblock); + +/** @deprecated Replaced by krb5_auth_con_getrecvsubkey(). */ +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV +krb5_auth_con_getremotesubkey(krb5_context context, krb5_auth_context auth_context, + krb5_keyblock **keyblock); +#endif + +/** + * Retrieve the local sequence number from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] seqnumber Local sequence number + * + * Retrieve the local sequence number from @a auth_context and return it in @a + * seqnumber. The #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag must be set in @a + * auth_context for this function to be useful. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getlocalseqnumber(krb5_context context, krb5_auth_context auth_context, + krb5_int32 *seqnumber); + +/** + * Retrieve the remote sequence number from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] seqnumber Remote sequence number + * + * Retrieve the remote sequence number from @a auth_context and return it in @a + * seqnumber. The #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag must be set in @a + * auth_context for this function to be useful. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getremoteseqnumber(krb5_context context, krb5_auth_context auth_context, + krb5_int32 *seqnumber); + +/** + * Cause an auth context to use cipher state. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * + * Prepare @a auth_context to use cipher state when krb5_mk_priv() or + * krb5_rd_priv() encrypt or decrypt data. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_initivector(krb5_context context, krb5_auth_context auth_context); + +/** + * Set the replay cache in an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] rcache Replay cache haddle + * + * This function sets the replay cache in @a auth_context to @a rcache. @a + * rcache will be closed when @a auth_context is freed, so the caller should + * relinquish that responsibility. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_setrcache(krb5_context context, krb5_auth_context auth_context, + krb5_rcache rcache); + +/** + * Retrieve the replay cache from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] rcache Replay cache handle + * + * This function fetches the replay cache from @a auth_context. The caller + * should not close @a rcache. + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV_WRONG +krb5_auth_con_getrcache(krb5_context context, krb5_auth_context auth_context, + krb5_rcache *rcache); + +/** + * Retrieve the authenticator from an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [out] authenticator Authenticator + * + * Use krb5_free_authenticator() to free @a authenticator when it is no longer + * needed. + * + * @retval 0 Success. Otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_getauthenticator(krb5_context context, krb5_auth_context auth_context, + krb5_authenticator **authenticator); + +/** + * Set checksum type in an an auth context. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] cksumtype Checksum type + * + * This function sets the checksum type in @a auth_context to be used by + * krb5_mk_req() for the authenticator checksum. + * + * @retval 0 Success. Otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_set_req_cksumtype(krb5_context context, krb5_auth_context auth_context, + krb5_cksumtype cksumtype); + +#define KRB5_REALM_BRANCH_CHAR '.' + +/* + * end "func-proto.h" + */ + +/* + * begin stuff from libos.h + */ + +/** + * @brief Read a password from keyboard input. + * + * @param [in] context Library context + * @param [in] prompt First user prompt when reading password + * @param [in] prompt2 Second user prompt (NULL to prompt only once) + * @param [out] return_pwd Returned password + * @param [in,out] size_return On input, maximum size of password; on output, + * size of password read + * + * This function reads a password from keyboard input and stores it in @a + * return_pwd. @a size_return should be set by the caller to the amount of + * storage space available in @a return_pwd; on successful return, it will be + * set to the length of the password read. + * + * @a prompt is printed to the terminal, followed by ": ", and then a password + * is read from the keyboard. + * + * If @a prompt2 is NULL, the password is read only once. Otherwise, @a + * prompt2 is printed to the terminal and a second password is read. If the + * two passwords entered are not identical, KRB5_LIBOS_BADPWDMATCH is returned. + * + * Echoing is turned off when the password is read. + * + * @retval + * 0 Success + * @return + * Error in reading or verifying the password + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_read_password(krb5_context context, + const char *prompt, const char *prompt2, + char *return_pwd, unsigned int *size_return); + +/** + * Convert a principal name to a local name. + * + * @param [in] context Library context + * @param [in] aname Principal name + * @param [in] lnsize_in Space available in @a lname + * @param [out] lname Local name buffer to be filled in + * + * If @a aname does not correspond to any local account, KRB5_LNAME_NOTRANS is + * returned. If @a lnsize_in is too small for the local name, + * KRB5_CONFIG_NOTENUFSPACE is returned. + * + * Local names, rather than principal names, can be used by programs that + * translate to an environment-specific name (for example, a user account + * name). + * + * @retval + * 0 Success + * @retval + * System errors + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_aname_to_localname(krb5_context context, krb5_const_principal aname, + int lnsize_in, char *lname); + +/** + * Get the Kerberos realm names for a host. + * + * @param [in] context Library context + * @param [in] host Host name (or NULL) + * @param [out] realmsp Null-terminated list of realm names + * + * Fill in @a realmsp with a pointer to a null-terminated list of realm names. + * If there are no known realms for the host, a list containing the referral + * (empty) realm is returned. + * + * If @a host is NULL, the local host's realms are determined. + * + * Use krb5_free_host_realm() to release @a realmsp when it is no longer + * needed. + * + * @retval + * 0 Success + * @retval + * ENOMEM Insufficient memory + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_host_realm(krb5_context context, const char *host, char ***realmsp); + +/** + * + * @param [in] context Library context + * @param [in] hdata Host name (or NULL) + * @param [out] realmsp Null-terminated list of realm names + * + * Fill in @a realmsp with a pointer to a null-terminated list of realm names + * obtained through heuristics or insecure resolution methods which have lower + * priority than KDC referrals. + * + * If @a host is NULL, the local host's realms are determined. + * + * Use krb5_free_host_realm() to release @a realmsp when it is no longer + * needed. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_fallback_host_realm(krb5_context context, + krb5_data *hdata, char ***realmsp); + +/** + * Free the memory allocated by krb5_get_host_realm(). + * + * @param [in] context Library context + * @param [in] realmlist List of realm names to be released + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_free_host_realm(krb5_context context, char *const *realmlist); + +/** + * Determine if a principal is authorized to log in as a local user. + * + * @param [in] context Library context + * @param [in] principal Principal name + * @param [in] luser Local username + * + * Determine whether @a principal is authorized to log in as a local user @a + * luser. + * + * @retval + * TRUE Principal is authorized to log in as user; FALSE otherwise. + */ +krb5_boolean KRB5_CALLCONV +krb5_kuserok(krb5_context context, krb5_principal principal, const char *luser); + +/** + * Generate auth context addresses from a connected socket. + * + * @param [in] context Library context + * @param [in] auth_context Authentication context + * @param [in] infd Connected socket descriptor + * @param [in] flags Flags + * + * This function sets the local and/or remote addresses in @a auth_context + * based on the local and remote endpoints of the socket @a infd. The + * following flags determine the operations performed: + * + * @li #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR Generate local address. + * @li #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR Generate remote address. + * @li #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR Generate local address and port. + * @li #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR Generate remote address and port. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_auth_con_genaddrs(krb5_context context, krb5_auth_context auth_context, + int infd, int flags); + +/** + * Set time offset field in a krb5_context structure. + * + * @param [in] context Library context + * @param [in] seconds Real time, seconds portion + * @param [in] microseconds Real time, microseconds portion + * + * This function sets the time offset in @a context to the difference between + * the system time and the real time as determined by @a seconds and @a + * microseconds. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_set_real_time(krb5_context context, krb5_timestamp seconds, + krb5_int32 microseconds); + +/** + * Return the time offsets from the os context. + * + * @param [in] context Library context + * @param [out] seconds Time offset, seconds portion + * @param [out] microseconds Time offset, microseconds portion + * + * This function returns the time offsets in @a context. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_time_offsets(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds); + +/* str_conv.c */ +/** + * Convert a string to an encryption type. + * + * @param [in] string String to convert to an encryption type + * @param [out] enctypep Encryption type + * + * @retval 0 Success; otherwise - EINVAL + */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_enctype(char *string, krb5_enctype *enctypep); + +/** + * Convert a string to a salt type. + * + * @param [in] string String to convert to an encryption type + * @param [out] salttypep Salt type to be filled in + * + * @retval 0 Success; otherwise - EINVAL + */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_salttype(char *string, krb5_int32 *salttypep); + +/** + * Convert a string to a checksum type. + * + * @param [in] string String to be converted + * @param [out] cksumtypep Checksum type to be filled in + * + * @retval 0 Success; otherwise - EINVAL + */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep); + +/** + * Convert a string to a timestamp. + * + * @param [in] string String to be converted + * @param [out] timestampp Pointer to timestamp + * + * @retval 0 Success; otherwise - EINVAL + */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_timestamp(char *string, krb5_timestamp *timestampp); + +/** + * Convert a string to a delta time value. + * + * @param [in] string String to be converted + * @param [out] deltatp Delta time to be filled in + * + * @retval 0 Success; otherwise - KRB5_DELTAT_BADFORMAT + */ +krb5_error_code KRB5_CALLCONV +krb5_string_to_deltat(char *string, krb5_deltat *deltatp); + +/** + * Convert an encryption type to a string. + * + * @param [in] enctype Encryption type + * @param [out] buffer Buffer to hold encryption type string + * @param [in] buflen Storage available in @a buffer + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_enctype_to_string(krb5_enctype enctype, char *buffer, size_t buflen); + +/** + * Convert an encryption type to a name or alias. + * + * @param [in] enctype Encryption type + * @param [in] shortest Flag + * @param [out] buffer Buffer to hold encryption type string + * @param [in] buflen Storage available in @a buffer + * + * If @a shortest is FALSE, this function returns the enctype's canonical name + * (like "aes128-cts-hmac-sha1-96"). If @a shortest is TRUE, it return the + * enctype's shortest alias (like "aes128-cts"). + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_enctype_to_name(krb5_enctype enctype, krb5_boolean shortest, + char *buffer, size_t buflen); + +/** + * Convert a salt type to a string. + * + * @param [in] salttype Salttype to convert + * @param [out] buffer Buffer to receive the converted string + * @param [in] buflen Storage available in @a buffer + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_salttype_to_string(krb5_int32 salttype, char *buffer, size_t buflen); + +/** + * Convert a checksum type to a string. + * + * @param [in] cksumtype Checksum type + * @param [out] buffer Buffer to hold converted checksum type + * @param [in] buflen Storage available in @a buffer + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_cksumtype_to_string(krb5_cksumtype cksumtype, char *buffer, size_t buflen); + +/** + * Convert a timestamp to a string. + * + * @param [in] timestamp Timestamp to convert + * @param [out] buffer Buffer to hold converted timestamp + * @param [in] buflen Storage available in @a buffer + * + * The string is returned in the locale's appropriate date and time + * representation. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_timestamp_to_string(krb5_timestamp timestamp, char *buffer, size_t buflen); + +/** + * Convert a timestamp to a string, with optional output padding + * + * @param [in] timestamp Timestamp to convert + * @param [out] buffer Buffer to hold the converted timestamp + * @param [in] buflen Length of buffer + * @param [in] pad Optional value to pad @a buffer if converted + * timestamp does not fill it + * + * If @a pad is not NULL, @a buffer is padded out to @a buflen - 1 characters + * with the value of *@a pad. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_timestamp_to_sfstring(krb5_timestamp timestamp, char *buffer, + size_t buflen, char *pad); + +/** + * Convert a relative time value to a string. + * + * @param [in] deltat Relative time value to convert + * @param [out] buffer Buffer to hold time string + * @param [in] buflen Storage available in @a buffer + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_deltat_to_string(krb5_deltat deltat, char *buffer, size_t buflen); + +/* The name of the Kerberos ticket granting service... and its size */ +#define KRB5_TGS_NAME "krbtgt" +#define KRB5_TGS_NAME_SIZE 6 + +/* flags for recvauth */ +#define KRB5_RECVAUTH_SKIP_VERSION 0x0001 +#define KRB5_RECVAUTH_BADAUTHVERS 0x0002 +/* initial ticket api functions */ + +/** Text for prompt used in prompter callback function. */ +typedef struct _krb5_prompt { + char *prompt; /**< The prompt to show to the user */ + int hidden; /**< Boolean; informative prompt or hidden (e.g. PIN) */ + krb5_data *reply; /**< Must be allocated before call to prompt routine */ +} krb5_prompt; + +/** Pointer to a prompter callback function. */ +typedef krb5_error_code +(KRB5_CALLCONV *krb5_prompter_fct)(krb5_context context, void *data, + const char *name, const char *banner, + int num_prompts, krb5_prompt prompts[]); + +/** + * Prompt user for password. + * + * @param [in] context Library context + * @param data Unused (callback argument) + * @param [in] name Name to output during prompt + * @param [in] banner Banner to output during prompt + * @param [in] num_prompts Number of prompts in @a prompts + * @param [in] prompts Array of prompts and replies + * + * This function is intended to be used as a prompter callback for + * krb5_get_init_creds_password() or krb5_init_creds_init(). + * + * Writes @a name and @a banner to stdout, each followed by a newline, then + * writes each prompt field in the @a prompts array, followed by ": ", and sets + * the reply field of the entry to a line of input read from stdin. If the + * hidden flag is set for a prompt, then terminal echoing is turned off when + * input is read. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + * + */ +krb5_error_code KRB5_CALLCONV +krb5_prompter_posix(krb5_context context, void *data, const char *name, + const char *banner, int num_prompts, + krb5_prompt prompts[]); + +/** + * Long-term password responder question + * + * This question is asked when the long-term password is needed. It has no + * challenge and the response is simply the password string. + * + * @version New in 1.11 + */ +#define KRB5_RESPONDER_QUESTION_PASSWORD "password" + +/** + * OTP responder question + * + * The OTP responder question is asked when the KDC indicates that an OTP + * value is required in order to complete the authentication. The JSON format + * of the challenge is: + * + * { + * "service": , + * "tokenInfo": [ + * { + * "flags": , + * "vendor": , + * "challenge": , + * "length": , + * "format": , + * "tokenID": , + * "algID": , + * }, + * ... + * ] + * } + * + * The answer to the question MUST be JSON formatted: + * + * { + * "tokeninfo": , + * "value": , + * "pin": , + * } + * + * For more detail, please see RFC 6560. + * + * @version New in 1.11 + */ +#define KRB5_RESPONDER_QUESTION_OTP "otp" + +/** + * These format constants identify the format of the token value. + */ +#define KRB5_RESPONDER_OTP_FORMAT_DECIMAL 0 +#define KRB5_RESPONDER_OTP_FORMAT_HEXADECIMAL 1 +#define KRB5_RESPONDER_OTP_FORMAT_ALPHANUMERIC 2 + +/** + * This flag indicates that the token value MUST be collected. + */ +#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN 0x0001 + +/** + * This flag indicates that the PIN value MUST be collected. + */ +#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN 0x0002 + +/** + * This flag indicates that the token is now in re-synchronization mode with + * the server. The user is expected to reply with the next code displayed on + * the token. + */ +#define KRB5_RESPONDER_OTP_FLAGS_NEXTOTP 0x0004 + +/** + * This flag indicates that the PIN MUST be returned as a separate item. This + * flag only takes effect if KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN is set. If + * this flag is not set, the responder may either concatenate PIN + token value + * and store it as "value" in the answer or it may return them separately. If + * they are returned separately, they will be concatenated internally. + */ +#define KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN 0x0008 + +/** + * PKINIT responder question + * + * The PKINIT responder question is asked when the client needs a password + * that's being used to protect key information, and is formatted as a JSON + * object. A specific identity's flags value, if not zero, is the bitwise-OR + * of one or more of the KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_* flags defined + * below, and possibly other flags to be added later. Any resemblance to + * similarly-named CKF_* values in the PKCS#11 API should not be depended on. + * + * { + * identity : flags , + * ... + * } + * + * The answer to the question MUST be JSON formatted: + * + * { + * identity : password , + * ... + * } + * + * @version New in 1.12 + */ +#define KRB5_RESPONDER_QUESTION_PKINIT "pkinit" + +/** + * This flag indicates that an incorrect PIN was supplied at least once since + * the last time the correct PIN was supplied. + */ +#define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_COUNT_LOW (1 << 0) + +/** + * This flag indicates that supplying an incorrect PIN will cause the token to + * lock itself. + */ +#define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_FINAL_TRY (1 << 1) + +/** + * This flag indicates that the user PIN is locked, and you can't log in to the + * token with it. + */ +#define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_LOCKED (1 << 2) + +/** + * A container for a set of preauthentication questions and answers + * + * A responder context is supplied by the krb5 authentication system to a + * krb5_responder_fn callback. It contains a list of questions and can receive + * answers. Questions contained in a responder context can be listed using + * krb5_responder_list_questions(), retrieved using + * krb5_responder_get_challenge(), or answered using + * krb5_responder_set_answer(). The form of a question's challenge and answer + * depend on the question name. + * + * @version New in 1.11 + */ +typedef struct krb5_responder_context_st *krb5_responder_context; + +/** + * List the question names contained in the responder context. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * + * Return a pointer to a null-terminated list of question names which are + * present in @a rctx. The pointer is an alias, valid only as long as the + * lifetime of @a rctx, and should not be modified or freed by the caller. A + * question's challenge can be retrieved using krb5_responder_get_challenge() + * and answered using krb5_responder_set_answer(). + * + * @version New in 1.11 + */ +const char * const * KRB5_CALLCONV +krb5_responder_list_questions(krb5_context ctx, krb5_responder_context rctx); + +/** + * Retrieve the challenge data for a given question in the responder context. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] question Question name + * + * Return a pointer to a C string containing the challenge for @a question + * within @a rctx, or NULL if the question is not present in @a rctx. The + * structure of the question depends on the question name, but will always be + * printable UTF-8 text. The returned pointer is an alias, valid only as long + * as the lifetime of @a rctx, and should not be modified or freed by the + * caller. + * + * @version New in 1.11 + */ +const char * KRB5_CALLCONV +krb5_responder_get_challenge(krb5_context ctx, krb5_responder_context rctx, + const char *question); + +/** + * Answer a named question in the responder context. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] question Question name + * @param [in] answer The string to set (MUST be printable UTF-8) + * + * This function supplies an answer to @a question within @a rctx. The + * appropriate form of the answer depends on the question name. + * + * @retval EINVAL @a question is not present within @a rctx + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_responder_set_answer(krb5_context ctx, krb5_responder_context rctx, + const char *question, const char *answer); + +/** + * Responder function for an initial credential exchange. + * + * @param [in] ctx Library context + * @param [in] data Callback data + * @param [in] rctx Responder context + * + * A responder function is like a prompter function, but is used for handling + * questions and answers as potentially complex data types. Client + * preauthentication modules will insert a set of named "questions" into + * the responder context. Each question may optionally contain a challenge. + * This challenge is printable UTF-8, but may be an encoded value. The + * precise encoding and contents of the challenge are specific to the question + * asked. When the responder is called, it should answer all the questions it + * understands. Like the challenge, the answer MUST be printable UTF-8, but + * may contain structured/encoded data formatted to the expected answer format + * of the question. + * + * If a required question is unanswered, the prompter may be called. + */ +typedef krb5_error_code +(KRB5_CALLCONV *krb5_responder_fn)(krb5_context ctx, void *data, + krb5_responder_context rctx); + +typedef struct _krb5_responder_otp_tokeninfo { + krb5_flags flags; + krb5_int32 format; /* -1 when not specified. */ + krb5_int32 length; /* -1 when not specified. */ + char *vendor; + char *challenge; + char *token_id; + char *alg_id; +} krb5_responder_otp_tokeninfo; + +typedef struct _krb5_responder_otp_challenge { + char *service; + krb5_responder_otp_tokeninfo **tokeninfo; +} krb5_responder_otp_challenge; + +/** + * Decode the KRB5_RESPONDER_QUESTION_OTP to a C struct. + * + * A convenience function which parses the KRB5_RESPONDER_QUESTION_OTP + * question challenge data, making it available in native C. The main feature + * of this function is the ability to interact with OTP tokens without parsing + * the JSON. + * + * The returned value must be passed to krb5_responder_otp_challenge_free() to + * be freed. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [out] chl Challenge structure + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_responder_otp_get_challenge(krb5_context ctx, + krb5_responder_context rctx, + krb5_responder_otp_challenge **chl); + +/** + * Answer the KRB5_RESPONDER_QUESTION_OTP question. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] ti The index of the tokeninfo selected + * @param [in] value The value to set, or NULL for none + * @param [in] pin The pin to set, or NULL for none + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_responder_otp_set_answer(krb5_context ctx, krb5_responder_context rctx, + size_t ti, const char *value, const char *pin); + +/** + * Free the value returned by krb5_responder_otp_get_challenge(). + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] chl The challenge to free + * + * @version New in 1.11 + */ +void KRB5_CALLCONV +krb5_responder_otp_challenge_free(krb5_context ctx, + krb5_responder_context rctx, + krb5_responder_otp_challenge *chl); + +typedef struct _krb5_responder_pkinit_identity { + char *identity; + krb5_int32 token_flags; /* 0 when not specified or not applicable. */ +} krb5_responder_pkinit_identity; + +typedef struct _krb5_responder_pkinit_challenge { + krb5_responder_pkinit_identity **identities; +} krb5_responder_pkinit_challenge; + +/** + * Decode the KRB5_RESPONDER_QUESTION_PKINIT to a C struct. + * + * A convenience function which parses the KRB5_RESPONDER_QUESTION_PKINIT + * question challenge data, making it available in native C. The main feature + * of this function is the ability to read the challenge without parsing + * the JSON. + * + * The returned value must be passed to krb5_responder_pkinit_challenge_free() + * to be freed. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [out] chl_out Challenge structure + * + * @version New in 1.12 + */ +krb5_error_code KRB5_CALLCONV +krb5_responder_pkinit_get_challenge(krb5_context ctx, + krb5_responder_context rctx, + krb5_responder_pkinit_challenge **chl_out); + +/** + * Answer the KRB5_RESPONDER_QUESTION_PKINIT question for one identity. + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] identity The identity for which a PIN is being supplied + * @param [in] pin The provided PIN, or NULL for none + * + * @version New in 1.12 + */ +krb5_error_code KRB5_CALLCONV +krb5_responder_pkinit_set_answer(krb5_context ctx, krb5_responder_context rctx, + const char *identity, const char *pin); + +/** + * Free the value returned by krb5_responder_pkinit_get_challenge(). + * + * @param [in] ctx Library context + * @param [in] rctx Responder context + * @param [in] chl The challenge to free + * + * @version New in 1.12 + */ +void KRB5_CALLCONV +krb5_responder_pkinit_challenge_free(krb5_context ctx, + krb5_responder_context rctx, + krb5_responder_pkinit_challenge *chl); + +/** Store options for @c _krb5_get_init_creds */ +typedef struct _krb5_get_init_creds_opt { + krb5_flags flags; + krb5_deltat tkt_life; + krb5_deltat renew_life; + int forwardable; + int proxiable; + krb5_enctype *etype_list; + int etype_list_length; + krb5_address **address_list; + krb5_preauthtype *preauth_list; + int preauth_list_length; + krb5_data *salt; +} krb5_get_init_creds_opt; + +#define KRB5_GET_INIT_CREDS_OPT_TKT_LIFE 0x0001 +#define KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE 0x0002 +#define KRB5_GET_INIT_CREDS_OPT_FORWARDABLE 0x0004 +#define KRB5_GET_INIT_CREDS_OPT_PROXIABLE 0x0008 +#define KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST 0x0010 +#define KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST 0x0020 +#define KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST 0x0040 +#define KRB5_GET_INIT_CREDS_OPT_SALT 0x0080 +#define KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT 0x0100 +#define KRB5_GET_INIT_CREDS_OPT_CANONICALIZE 0x0200 +#define KRB5_GET_INIT_CREDS_OPT_ANONYMOUS 0x0400 + + +/** + * Allocate a new initial credential options structure. + * + * @param [in] context Library context + * @param [out] opt New options structure + * + * This function is the preferred way to create an options structure for + * getting initial credentials, and is required to make use of certain options. + * Use krb5_get_init_creds_opt_free() to free @a opt when it is no longer + * needed. + * + * @retval 0 - Success; Kerberos errors otherwise. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_alloc(krb5_context context, + krb5_get_init_creds_opt **opt); + +/** + * Free initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options structure to free + * + * @sa krb5_get_init_creds_opt_alloc() + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_free(krb5_context context, + krb5_get_init_creds_opt *opt); + +/** @deprecated Use krb5_get_init_creds_opt_alloc() instead. */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt); + +/** + * Set the ticket lifetime in initial credential options. + * + * @param [in] opt Options structure + * @param [in] tkt_life Ticket lifetime + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_tkt_life(krb5_get_init_creds_opt *opt, + krb5_deltat tkt_life); + +/** + * Set the ticket renewal lifetime in initial credential options. + * + * @param [in] opt Pointer to @a options field + * @param [in] renew_life Ticket renewal lifetime + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_renew_life(krb5_get_init_creds_opt *opt, + krb5_deltat renew_life); + +/** + * Set or unset the forwardable flag in initial credential options. + * + * @param [in] opt Options structure + * @param [in] forwardable Whether credentials should be forwardable + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_forwardable(krb5_get_init_creds_opt *opt, + int forwardable); + +/** + * Set or unset the proxiable flag in initial credential options. + * + * @param [in] opt Options structure + * @param [in] proxiable Whether credentials should be proxiable + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_proxiable(krb5_get_init_creds_opt *opt, + int proxiable); + +/** + * Set or unset the canonicalize flag in initial credential options. + * + * @param [in] opt Options structure + * @param [in] canonicalize Whether to canonicalize client principal + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_canonicalize(krb5_get_init_creds_opt *opt, + int canonicalize); + +/** + * Set or unset the anonymous flag in initial credential options. + * + * @param [in] opt Options structure + * @param [in] anonymous Whether to make an anonymous request + * + * This function may be used to request anonymous credentials from the KDC by + * setting @a anonymous to non-zero. Note that anonymous credentials are only + * a request; clients must verify that credentials are anonymous if that is a + * requirement. + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_anonymous(krb5_get_init_creds_opt *opt, + int anonymous); + +/** + * Set allowable encryption types in initial credential options. + * + * @param [in] opt Options structure + * @param [in] etype_list Array of encryption types + * @param [in] etype_list_length Length of @a etype_list + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_etype_list(krb5_get_init_creds_opt *opt, + krb5_enctype *etype_list, + int etype_list_length); + +/** + * Set address restrictions in initial credential options. + * + * @param [in] opt Options structure + * @param [in] addresses Null-terminated array of addresses + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_address_list(krb5_get_init_creds_opt *opt, + krb5_address **addresses); + +/** + * Set preauthentication types in initial credential options. + * + * @param [in] opt Options structure + * @param [in] preauth_list Array of preauthentication types + * @param [in] preauth_list_length Length of @a preauth_list + * + * This function can be used to perform optimistic preauthentication when + * getting initial credentials, in combination with + * krb5_get_init_creds_opt_set_salt() and krb5_get_init_creds_opt_set_pa(). + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_preauth_list(krb5_get_init_creds_opt *opt, + krb5_preauthtype *preauth_list, + int preauth_list_length); + +/** + * Set salt for optimistic preauthentication in initial credential options. + * + * @param [in] opt Options structure + * @param [in] salt Salt data + * + * When getting initial credentials with a password, a salt string it used to + * convert the password to a key. Normally this salt is obtained from the + * first KDC reply, but when performing optimistic preauthentication, the + * client may need to supply the salt string with this function. + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_salt(krb5_get_init_creds_opt *opt, + krb5_data *salt); + +/** + * Set or unset change-password-prompt flag in initial credential options. + * + * @param [in] opt Options structure + * @param [in] prompt Whether to prompt to change password + * + * This flag is on by default. It controls whether + * krb5_get_init_creds_password() will react to an expired-password error by + * prompting for a new password and attempting to change the old one. + */ +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_change_password_prompt(krb5_get_init_creds_opt *opt, + int prompt); + +/** Generic preauth option attribute/value pairs */ +typedef struct _krb5_gic_opt_pa_data { + char *attr; + char *value; +} krb5_gic_opt_pa_data; + +/** + * Supply options for preauthentication in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options structure + * @param [in] attr Preauthentication option name + * @param [in] value Preauthentication option value + * + * This function allows the caller to supply options for preauthentication. + * The values of @a attr and @a value are supplied to each preauthentication + * module available within @a context. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_pa(krb5_context context, + krb5_get_init_creds_opt *opt, const char *attr, + const char *value); + +/** + * Set location of FAST armor ccache in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [in] fast_ccache_name Credential cache name + * + * Sets the location of a credential cache containing an armor ticket to + * protect an initial credential exchange using the FAST protocol extension. + * + * In version 1.7, setting an armor ccache requires that FAST be used for the + * exchange. In version 1.8 or later, setting the armor ccache causes FAST to + * be used if the KDC supports it; krb5_get_init_creds_opt_set_fast_flags() + * must be used to require that FAST be used. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_fast_ccache_name(krb5_context context, + krb5_get_init_creds_opt *opt, + const char *fast_ccache_name); + +/** + * Set FAST armor cache in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [in] ccache Credential cache handle + * + * This function is similar to krb5_get_init_creds_opt_set_fast_ccache_name(), + * but uses a credential cache handle instead of a name. + * + * @version New in 1.9 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_fast_ccache(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_ccache ccache); + +/** + * Set an input credential cache in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [in] ccache Credential cache handle + * + * If an input credential cache is set, then the krb5_get_init_creds family of + * APIs will read settings from it. Setting an input ccache is desirable when + * the application wishes to perform authentication in the same way (using the + * same preauthentication mechanisms, and making the same non-security- + * sensitive choices) as the previous authentication attempt, which stored + * information in the passed-in ccache. + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_in_ccache(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_ccache ccache); + +/** + * Set an output credential cache in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [in] ccache Credential cache handle + * + * If an output credential cache is set, then the krb5_get_init_creds family of + * APIs will write credentials to it. Setting an output ccache is desirable + * both because it simplifies calling code and because it permits the + * krb5_get_init_creds APIs to write out configuration information about the + * realm to the ccache. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_out_ccache(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_ccache ccache); + +/** + * @brief Ask the KDC to include or not include a PAC in the ticket + * + * @param [in] context Library context + * @param [in] opt Options structure + * @param [in] req_pac Whether to request a PAC or not + * + * If this option is set, the AS request will include a PAC-REQUEST pa-data + * item explicitly asking the KDC to either include or not include a privilege + * attribute certificate in the ticket authorization data. By default, no + * request is made; typically the KDC will default to including a PAC if it + * supports them. + * + * @version New in 1.15 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_pac_request(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_boolean req_pac); + +/** + * Set FAST flags in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [in] flags FAST flags + * + * The following flag values are valid: + * @li #KRB5_FAST_REQUIRED - Require FAST to be used + * + * @retval + * 0 - Success; Kerberos errors otherwise. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_fast_flags(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_flags flags); + +/** + * Retrieve FAST flags from initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options + * @param [out] out_flags FAST flags + * + * @retval + * 0 - Success; Kerberos errors otherwise. + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_get_fast_flags(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_flags *out_flags); + +/* Fast flags*/ +#define KRB5_FAST_REQUIRED 0x0001 /**< Require KDC to support FAST*/ + +typedef void +(KRB5_CALLCONV *krb5_expire_callback_func)(krb5_context context, void *data, + krb5_timestamp password_expiration, + krb5_timestamp account_expiration, + krb5_boolean is_last_req); + +/** + * Set an expiration callback in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options structure + * @param [in] cb Callback function + * @param [in] data Callback argument + * + * Set a callback to receive password and account expiration times. + * + * @a cb will be invoked if and only if credentials are successfully acquired. + * The callback will receive the @a context from the calling function and the + * @a data argument supplied with this API. The remaining arguments should be + * interpreted as follows: + * + * If @a is_last_req is true, then the KDC reply contained last-req entries + * which unambiguously indicated the password expiration, account expiration, + * or both. (If either value was not present, the corresponding argument will + * be 0.) Furthermore, a non-zero @a password_expiration should be taken as a + * suggestion from the KDC that a warning be displayed. + * + * If @a is_last_req is false, then @a account_expiration will be 0 and @a + * password_expiration will contain the expiration time of either the password + * or account, or 0 if no expiration time was indicated in the KDC reply. The + * callback should independently decide whether to display a password + * expiration warning. + * + * Note that @a cb may be invoked even if credentials are being acquired for + * the kadmin/changepw service in order to change the password. It is the + * caller's responsibility to avoid displaying a password expiry warning in + * this case. + * + * @warning Setting an expire callback with this API will cause + * krb5_get_init_creds_password() not to send password expiry warnings to the + * prompter, as it ordinarily may. + * + * @version New in 1.9 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_expire_callback(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_expire_callback_func cb, + void *data); + +/** + * Set the responder function in initial credential options. + * + * @param [in] context Library context + * @param [in] opt Options structure + * @param [in] responder Responder function + * @param [in] data Responder data argument + * + * @version New in 1.11 + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_opt_set_responder(krb5_context context, + krb5_get_init_creds_opt *opt, + krb5_responder_fn responder, void *data); + +/** + * Get initial credentials using a password. + * + * @param [in] context Library context + * @param [out] creds New credentials + * @param [in] client Client principal + * @param [in] password Password (or NULL) + * @param [in] prompter Prompter function + * @param [in] data Prompter callback data + * @param [in] start_time Time when ticket becomes valid (0 for now) + * @param [in] in_tkt_service Service name of initial credentials (or NULL) + * @param [in] k5_gic_options Initial credential options + * + * This function requests KDC for an initial credentials for @a client using @a + * password. If @a password is NULL, a password will be prompted for using @a + * prompter if necessary. If @a in_tkt_service is specified, it is parsed as a + * principal name (with the realm ignored) and used as the service principal + * for the request; otherwise the ticket-granting service is used. + * + * @sa krb5_verify_init_creds() + * + * @retval + * 0 Success + * @retval + * EINVAL Invalid argument + * @retval + * KRB5_KDC_UNREACH Cannot contact any KDC for requested realm + * @retval + * KRB5_PREAUTH_FAILED Generic Pre-athentication failure + * @retval + * KRB5_LIBOS_PWDINTR Password read interrupted + * @retval + * KRB5_REALM_CANT_RESOLVE Cannot resolve network address for KDC in requested realm + * @retval + * KRB5KDC_ERR_KEY_EXP Password has expired + * @retval + * KRB5_LIBOS_BADPWDMATCH Password mismatch + * @retval + * KRB5_CHPW_PWDNULL New password cannot be zero length + * @retval + * KRB5_CHPW_FAIL Password change failed + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, + krb5_principal client, const char *password, + krb5_prompter_fct prompter, void *data, + krb5_deltat start_time, + const char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +/** + * Retrieve enctype, salt and s2kparams from KDC + * + * @param [in] context Library context + * @param [in] principal Principal whose information is requested + * @param [in] opt Initial credential options + * @param [out] enctype_out The enctype chosen by KDC + * @param [out] salt_out Salt returned from KDC + * @param [out] s2kparams_out String-to-key parameters returned from KDC + * + * Send an initial ticket request for @a principal and extract the encryption + * type, salt type, and string-to-key parameters from the KDC response. If the + * KDC provides no etype-info, set @a enctype_out to @c ENCTYPE_NULL and set @a + * salt_out and @a s2kparams_out to empty. If the KDC etype-info provides no + * salt, compute the default salt and place it in @a salt_out. If the KDC + * etype-info provides no string-to-key parameters, set @a s2kparams_out to + * empty. + * + * @a opt may be used to specify options which affect the initial request, such + * as request encryption types or a FAST armor cache (see + * krb5_get_init_creds_opt_set_etype_list() and + * krb5_get_init_creds_opt_set_fast_ccache_name()). + * + * Use krb5_free_data_contents() to free @a salt_out and @a s2kparams_out when + * they are no longer needed. + * + * @version New in 1.17 + * + * @retval 0 Success + * @return A Kerberos error code + */ +krb5_error_code KRB5_CALLCONV +krb5_get_etype_info(krb5_context context, krb5_principal principal, + krb5_get_init_creds_opt *opt, krb5_enctype *enctype_out, + krb5_data *salt_out, krb5_data *s2kparams_out); + +struct _krb5_init_creds_context; +typedef struct _krb5_init_creds_context *krb5_init_creds_context; + +#define KRB5_INIT_CREDS_STEP_FLAG_CONTINUE 0x1 /**< More responses needed */ + +/** + * Free an initial credentials context. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * + * @a context must be the same as the one passed to krb5_init_creds_init() for + * this initial credentials context. + */ +void KRB5_CALLCONV +krb5_init_creds_free(krb5_context context, krb5_init_creds_context ctx); + +/** + * Acquire credentials using an initial credentials context. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * + * This function synchronously obtains credentials using a context created by + * krb5_init_creds_init(). On successful return, the credentials can be + * retrieved with krb5_init_creds_get_creds(). + * + * @a context must be the same as the one passed to krb5_init_creds_init() for + * this initial credentials context. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_get(krb5_context context, krb5_init_creds_context ctx); + +/** + * Retrieve acquired credentials from an initial credentials context. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [out] creds Acquired credentials + * + * This function copies the acquired initial credentials from @a ctx into @a + * creds, after the successful completion of krb5_init_creds_get() or + * krb5_init_creds_step(). Use krb5_free_cred_contents() to free @a creds when + * it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_get_creds(krb5_context context, krb5_init_creds_context ctx, + krb5_creds *creds); + +/** + * Get the last error from KDC from an initial credentials context. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [out] error Error from KDC, or NULL if none was received + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_get_error(krb5_context context, krb5_init_creds_context ctx, + krb5_error **error); + +/** + * Create a context for acquiring initial credentials. + * + * @param [in] context Library context + * @param [in] client Client principal to get initial creds for + * @param [in] prompter Prompter callback + * @param [in] data Prompter callback argument + * @param [in] start_time Time when credentials become valid (0 for now) + * @param [in] options Options structure (NULL for default) + * @param [out] ctx New initial credentials context + * + * This function creates a new context for acquiring initial credentials. Use + * krb5_init_creds_free() to free @a ctx when it is no longer needed. + * + * Any subsequent calls to krb5_init_creds_step(), krb5_init_creds_get(), or + * krb5_init_creds_free() for this initial credentials context must use the + * same @a context argument as the one passed to this function. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_init(krb5_context context, krb5_principal client, + krb5_prompter_fct prompter, void *data, + krb5_deltat start_time, krb5_get_init_creds_opt *options, + krb5_init_creds_context *ctx); + +/** + * Specify a keytab to use for acquiring initial credentials. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [in] keytab Key table handle + * + * This function supplies a keytab containing the client key for an initial + * credentials request. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_set_keytab(krb5_context context, krb5_init_creds_context ctx, + krb5_keytab keytab); + +/** + * Get the next KDC request for acquiring initial credentials. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [in] in KDC response (empty on the first call) + * @param [out] out Next KDC request + * @param [out] realm Realm for next KDC request + * @param [out] flags Output flags + * + * This function constructs the next KDC request in an initial credential + * exchange, allowing the caller to control the transport of KDC requests and + * replies. On the first call, @a in should be set to an empty buffer; on + * subsequent calls, it should be set to the KDC's reply to the previous + * request. + * + * If more requests are needed, @a flags will be set to + * #KRB5_INIT_CREDS_STEP_FLAG_CONTINUE and the next request will be placed in + * @a out. If no more requests are needed, @a flags will not contain + * #KRB5_INIT_CREDS_STEP_FLAG_CONTINUE and @a out will be empty. + * + * If this function returns @c KRB5KRB_ERR_RESPONSE_TOO_BIG, the caller should + * transmit the next request using TCP rather than UDP. If this function + * returns any other error, the initial credential exchange has failed. + * + * @a context must be the same as the one passed to krb5_init_creds_init() for + * this initial credentials context. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_step(krb5_context context, krb5_init_creds_context ctx, + krb5_data *in, krb5_data *out, krb5_data *realm, + unsigned int *flags); + +/** + * Set a password for acquiring initial credentials. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [in] password Password + * + * This function supplies a password to be used to construct the client key for + * an initial credentials request. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_set_password(krb5_context context, krb5_init_creds_context ctx, + const char *password); + +/** + * Specify a service principal for acquiring initial credentials. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [in] service Service principal string + * + * This function supplies a service principal string to acquire initial + * credentials for instead of the default krbtgt service. @a service is parsed + * as a principal name; any realm part is ignored. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_set_service(krb5_context context, krb5_init_creds_context ctx, + const char *service); + +/** + * Retrieve ticket times from an initial credentials context. + * + * @param [in] context Library context + * @param [in] ctx Initial credentials context + * @param [out] times Ticket times for acquired credentials + * + * The initial credentials context must have completed obtaining credentials + * via either krb5_init_creds_get() or krb5_init_creds_step(). + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_init_creds_get_times(krb5_context context, krb5_init_creds_context ctx, + krb5_ticket_times *times); + +struct _krb5_tkt_creds_context; +typedef struct _krb5_tkt_creds_context *krb5_tkt_creds_context; + +/** + * Create a context to get credentials from a KDC's Ticket Granting Service. + * + * @param[in] context Library context + * @param[in] ccache Credential cache handle + * @param[in] creds Input credentials + * @param[in] options Options (see KRB5_GC macros) + * @param[out] ctx New TGS request context + * + * This function prepares to obtain credentials matching @a creds, either by + * retrieving them from @a ccache or by making requests to ticket-granting + * services beginning with a ticket-granting ticket for the client principal's + * realm. + * + * The resulting TGS acquisition context can be used asynchronously with + * krb5_tkt_creds_step() or synchronously with krb5_tkt_creds_get(). See also + * krb5_get_credentials() for synchronous use. + * + * Use krb5_tkt_creds_free() to free @a ctx when it is no longer needed. + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_tkt_creds_init(krb5_context context, krb5_ccache ccache, + krb5_creds *creds, krb5_flags options, + krb5_tkt_creds_context *ctx); + +/** + * Synchronously obtain credentials using a TGS request context. + * + * @param[in] context Library context + * @param[in] ctx TGS request context + * + * This function synchronously obtains credentials using a context created by + * krb5_tkt_creds_init(). On successful return, the credentials can be + * retrieved with krb5_tkt_creds_get_creds(). + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_tkt_creds_get(krb5_context context, krb5_tkt_creds_context ctx); + +/** + * Retrieve acquired credentials from a TGS request context. + * + * @param[in] context Library context + * @param[in] ctx TGS request context + * @param[out] creds Acquired credentials + * + * This function copies the acquired initial credentials from @a ctx into @a + * creds, after the successful completion of krb5_tkt_creds_get() or + * krb5_tkt_creds_step(). Use krb5_free_cred_contents() to free @a creds when + * it is no longer needed. + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_tkt_creds_get_creds(krb5_context context, krb5_tkt_creds_context ctx, + krb5_creds *creds); + +/** + * Free a TGS request context. + * + * @param[in] context Library context + * @param[in] ctx TGS request context + * + * @version New in 1.9 + */ +void KRB5_CALLCONV +krb5_tkt_creds_free(krb5_context context, krb5_tkt_creds_context ctx); + +#define KRB5_TKT_CREDS_STEP_FLAG_CONTINUE 0x1 /**< More responses needed */ + +/** + * Get the next KDC request in a TGS exchange. + * + * @param[in] context Library context + * @param[in] ctx TGS request context + * @param[in] in KDC response (empty on the first call) + * @param[out] out Next KDC request + * @param[out] realm Realm for next KDC request + * @param[out] flags Output flags + * + * This function constructs the next KDC request for a TGS exchange, allowing + * the caller to control the transport of KDC requests and replies. On the + * first call, @a in should be set to an empty buffer; on subsequent calls, it + * should be set to the KDC's reply to the previous request. + * + * If more requests are needed, @a flags will be set to + * #KRB5_TKT_CREDS_STEP_FLAG_CONTINUE and the next request will be placed in @a + * out. If no more requests are needed, @a flags will not contain + * #KRB5_TKT_CREDS_STEP_FLAG_CONTINUE and @a out will be empty. + * + * If this function returns @c KRB5KRB_ERR_RESPONSE_TOO_BIG, the caller should + * transmit the next request using TCP rather than UDP. If this function + * returns any other error, the TGS exchange has failed. + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_tkt_creds_step(krb5_context context, krb5_tkt_creds_context ctx, + krb5_data *in, krb5_data *out, krb5_data *realm, + unsigned int *flags); + +/** + * Retrieve ticket times from a TGS request context. + * + * @param[in] context Library context + * @param[in] ctx TGS request context + * @param[out] times Ticket times for acquired credentials + * + * The TGS request context must have completed obtaining credentials via either + * krb5_tkt_creds_get() or krb5_tkt_creds_step(). + * + * @version New in 1.9 + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_tkt_creds_get_times(krb5_context context, krb5_tkt_creds_context ctx, + krb5_ticket_times *times); + +/** + * Get initial credentials using a key table. + * + * @param [in] context Library context + * @param [out] creds New credentials + * @param [in] client Client principal + * @param [in] arg_keytab Key table handle + * @param [in] start_time Time when ticket becomes valid (0 for now) + * @param [in] in_tkt_service Service name of initial credentials (or NULL) + * @param [in] k5_gic_options Initial credential options + * + * This function requests KDC for an initial credentials for @a client using a + * client key stored in @a arg_keytab. If @a in_tkt_service is specified, it + * is parsed as a principal name (with the realm ignored) and used as the + * service principal for the request; otherwise the ticket-granting service is + * used. + * + * @sa krb5_verify_init_creds() + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_keytab(krb5_context context, krb5_creds *creds, + krb5_principal client, krb5_keytab arg_keytab, + krb5_deltat start_time, const char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +typedef struct _krb5_verify_init_creds_opt { + krb5_flags flags; + int ap_req_nofail; /**< boolean */ +} krb5_verify_init_creds_opt; + +#define KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL 0x0001 + +/** + * Initialize a credential verification options structure. + * + * @param [in] k5_vic_options Verification options structure + */ +void KRB5_CALLCONV +krb5_verify_init_creds_opt_init(krb5_verify_init_creds_opt *k5_vic_options); + +/** + * Set whether credential verification is required. + * + * @param [in] k5_vic_options Verification options structure + * @param [in] ap_req_nofail Whether to require successful verification + * + * This function determines how krb5_verify_init_creds() behaves if no keytab + * information is available. If @a ap_req_nofail is @c FALSE, verification + * will be skipped in this case and krb5_verify_init_creds() will return + * successfully. If @a ap_req_nofail is @c TRUE, krb5_verify_init_creds() will + * not return successfully unless verification can be performed. + * + * If this function is not used, the behavior of krb5_verify_init_creds() is + * determined through configuration. + */ +void KRB5_CALLCONV +krb5_verify_init_creds_opt_set_ap_req_nofail(krb5_verify_init_creds_opt * k5_vic_options, + int ap_req_nofail); + +/** + * Verify initial credentials against a keytab. + * + * @param [in] context Library context + * @param [in] creds Initial credentials to be verified + * @param [in] server Server principal (or NULL) + * @param [in] keytab Key table (NULL to use default keytab) + * @param [in] ccache Credential cache for fetched creds (or NULL) + * @param [in] options Verification options (NULL for default options) + * + * This function attempts to verify that @a creds were obtained from a KDC with + * knowledge of a key in @a keytab, or the default keytab if @a keytab is NULL. + * If @a server is provided, the highest-kvno key entry for that principal name + * is used to verify the credentials; otherwise, all unique "host" service + * principals in the keytab are tried. + * + * If the specified keytab does not exist, or is empty, or cannot be read, or + * does not contain an entry for @a server, then credential verification may be + * skipped unless configuration demands that it succeed. The caller can + * control this behavior by providing a verification options structure; see + * krb5_verify_init_creds_opt_init() and + * krb5_verify_init_creds_opt_set_ap_req_nofail(). + * + * If @a ccache is NULL, any additional credentials fetched during the + * verification process will be destroyed. If @a ccache points to NULL, a + * memory ccache will be created for the additional credentials and returned in + * @a ccache. If @a ccache points to a valid credential cache handle, the + * additional credentials will be stored in that cache. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_verify_init_creds(krb5_context context, krb5_creds *creds, + krb5_principal server, krb5_keytab keytab, + krb5_ccache *ccache, + krb5_verify_init_creds_opt *options); + +/** + * Get validated credentials from the KDC. + * + * @param [in] context Library context + * @param [out] creds Validated credentials + * @param [in] client Client principal name + * @param [in] ccache Credential cache + * @param [in] in_tkt_service Server principal string (or NULL) + * + * This function gets a validated credential using a postdated credential from + * @a ccache. If @a in_tkt_service is specified, it is parsed (with the realm + * part ignored) and used as the server principal of the credential; + * otherwise, the ticket-granting service is used. + * + * If successful, the validated credential is placed in @a creds. + * + * @sa krb5_get_renewed_creds() + * + * @retval + * 0 Success + * @retval + * KRB5_NO_2ND_TKT Request missing second ticket + * @retval + * KRB5_NO_TKT_SUPPLIED Request did not supply a ticket + * @retval + * KRB5_PRINC_NOMATCH Requested principal and ticket do not match + * @retval + * KRB5_KDCREP_MODIFIED KDC reply did not match expectations + * @retval + * KRB5_KDCREP_SKEW Clock skew too great in KDC reply + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_validated_creds(krb5_context context, krb5_creds *creds, + krb5_principal client, krb5_ccache ccache, + const char *in_tkt_service); + +/** + * Get renewed credential from KDC using an existing credential. + * + * @param [in] context Library context + * @param [out] creds Renewed credentials + * @param [in] client Client principal name + * @param [in] ccache Credential cache + * @param [in] in_tkt_service Server principal string (or NULL) + * + * This function gets a renewed credential using an existing one from @a + * ccache. If @a in_tkt_service is specified, it is parsed (with the realm + * part ignored) and used as the server principal of the credential; otherwise, + * the ticket-granting service is used. + * + * If successful, the renewed credential is placed in @a creds. + * + * @retval + * 0 Success + * @return + * Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_get_renewed_creds(krb5_context context, krb5_creds *creds, + krb5_principal client, krb5_ccache ccache, + const char *in_tkt_service); + +/** + * Decode an ASN.1-formatted ticket. + * + * @param [in] code ASN.1-formatted ticket + * @param [out] rep Decoded ticket information + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_decode_ticket(const krb5_data *code, krb5_ticket **rep); + +/** + * Retrieve a string value from the appdefaults section of krb5.conf. + * + * @param [in] context Library context + * @param [in] appname Application name + * @param [in] realm Realm name + * @param [in] option Option to be checked + * @param [in] default_value Default value to return if no match is found + * @param [out] ret_value String value of @a option + * + * This function gets the application defaults for @a option based on the given + * @a appname and/or @a realm. + * + * @sa krb5_appdefault_boolean() + */ +void KRB5_CALLCONV +krb5_appdefault_string(krb5_context context, const char *appname, + const krb5_data *realm, const char *option, + const char *default_value, char ** ret_value); + +/** + * Retrieve a boolean value from the appdefaults section of krb5.conf. + * + * @param [in] context Library context + * @param [in] appname Application name + * @param [in] realm Realm name + * @param [in] option Option to be checked + * @param [in] default_value Default value to return if no match is found + * @param [out] ret_value Boolean value of @a option + * + * This function gets the application defaults for @a option based on the given + * @a appname and/or @a realm. + * + * @sa krb5_appdefault_string() + */ +void KRB5_CALLCONV +krb5_appdefault_boolean(krb5_context context, const char *appname, + const krb5_data *realm, const char *option, + int default_value, int *ret_value); + +/* + * Prompter enhancements + */ +/** Prompt for password */ +#define KRB5_PROMPT_TYPE_PASSWORD 0x1 +/** Prompt for new password (during password change) */ +#define KRB5_PROMPT_TYPE_NEW_PASSWORD 0x2 +/** Prompt for new password again */ +#define KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN 0x3 +/** Prompt for preauthentication data (such as an OTP value) */ +#define KRB5_PROMPT_TYPE_PREAUTH 0x4 + +typedef krb5_int32 krb5_prompt_type; + +/** + * Get prompt types array from a context. + * + * @param [in] context Library context + * + * @return + * Pointer to an array of prompt types corresponding to the prompter's @a + * prompts arguments. Each type has one of the following values: + * @li #KRB5_PROMPT_TYPE_PASSWORD + * @li #KRB5_PROMPT_TYPE_NEW_PASSWORD + * @li #KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN + * @li #KRB5_PROMPT_TYPE_PREAUTH + */ +krb5_prompt_type* KRB5_CALLCONV +krb5_get_prompt_types(krb5_context context); + +/* Error reporting */ +/** + * Set an extended error message for an error code. + * + * @param [in] ctx Library context + * @param [in] code Error code + * @param [in] fmt Error string for the error code + * @param [in] ... printf(3) style parameters + */ +void KRB5_CALLCONV_C +krb5_set_error_message(krb5_context ctx, krb5_error_code code, const char *fmt, ...) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 4))) +#endif + ; + +/** + * Set an extended error message for an error code using a va_list. + * + * @param [in] ctx Library context + * @param [in] code Error code + * @param [in] fmt Error string for the error code + * @param [in] args List of vprintf(3) style arguments + */ +void KRB5_CALLCONV +krb5_vset_error_message(krb5_context ctx, krb5_error_code code, + const char *fmt, va_list args) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 0))) +#endif + ; + +/** + * Add a prefix to the message for an error code. + * + * @param [in] ctx Library context + * @param [in] code Error code + * @param [in] fmt Format string for error message prefix + * @param [in] ... printf(3) style parameters + * + * Format a message and prepend it to the current message for @a code. The + * prefix will be separated from the old message with a colon and space. + */ +void KRB5_CALLCONV_C +krb5_prepend_error_message(krb5_context ctx, krb5_error_code code, + const char *fmt, ...) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 4))) +#endif + ; + +/** + * Add a prefix to the message for an error code using a va_list. + * + * @param [in] ctx Library context + * @param [in] code Error code + * @param [in] fmt Format string for error message prefix + * @param [in] args List of vprintf(3) style arguments + * + * This function is similar to krb5_prepend_error_message(), but uses a + * va_list instead of variadic arguments. + */ +void KRB5_CALLCONV +krb5_vprepend_error_message(krb5_context ctx, krb5_error_code code, + const char *fmt, va_list args) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 3, 0))) +#endif + ; + +/** + * Add a prefix to a different error code's message. + * + * @param [in] ctx Library context + * @param [in] old_code Previous error code + * @param [in] code Error code + * @param [in] fmt Format string for error message prefix + * @param [in] ... printf(3) style parameters + * + * Format a message and prepend it to the message for @a old_code. The prefix + * will be separated from the old message with a colon and space. Set the + * resulting message as the extended error message for @a code. + */ +void KRB5_CALLCONV_C +krb5_wrap_error_message(krb5_context ctx, krb5_error_code old_code, + krb5_error_code code, const char *fmt, ...) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 4, 5))) +#endif + ; + +/** + * Add a prefix to a different error code's message using a va_list. + * + * @param [in] ctx Library context + * @param [in] old_code Previous error code + * @param [in] code Error code + * @param [in] fmt Format string for error message prefix + * @param [in] args List of vprintf(3) style arguments + * + * This function is similar to krb5_wrap_error_message(), but uses a + * va_list instead of variadic arguments. + */ +void KRB5_CALLCONV +krb5_vwrap_error_message(krb5_context ctx, krb5_error_code old_code, + krb5_error_code code, const char *fmt, va_list args) +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 4, 0))) +#endif + ; + +/** + * Copy the most recent extended error message from one context to another. + * + * @param [in] dest_ctx Library context to copy message to + * @param [in] src_ctx Library context with current message + */ +void KRB5_CALLCONV +krb5_copy_error_message(krb5_context dest_ctx, krb5_context src_ctx); + +/** + * Get the (possibly extended) error message for a code. + * + * @param [in] ctx Library context + * @param [in] code Error code + * + * The behavior of krb5_get_error_message() is only defined the first time it + * is called after a failed call to a krb5 function using the same context, and + * only when the error code passed in is the same as that returned by the krb5 + * function. + * + * This function never returns NULL, so its result may be used unconditionally + * as a C string. + * + * The string returned by this function must be freed using + * krb5_free_error_message() + * + * @note Future versions may return the same string for the second + * and following calls. + */ +const char * KRB5_CALLCONV +krb5_get_error_message(krb5_context ctx, krb5_error_code code); + +/** + * Free an error message generated by krb5_get_error_message(). + * + * @param [in] ctx Library context + * @param [in] msg Pointer to error message + */ +void KRB5_CALLCONV +krb5_free_error_message(krb5_context ctx, const char *msg); + +/** + * Clear the extended error message in a context. + * + * @param [in] ctx Library context + * + * This function unsets the extended error message in a context, to ensure that + * it is not mistakenly applied to another occurrence of the same error code. + */ +void KRB5_CALLCONV +krb5_clear_error_message(krb5_context ctx); + +/** + * Unwrap authorization data. + * + * @param [in] context Library context + * @param [in] type Container type (see KRB5_AUTHDATA macros) + * @param [in] container Authorization data to be decoded + * @param [out] authdata List of decoded authorization data + * + * @sa krb5_encode_authdata_container() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_decode_authdata_container(krb5_context context, + krb5_authdatatype type, + const krb5_authdata *container, + krb5_authdata ***authdata); +/** + * Wrap authorization data in a container. + * + * @param [in] context Library context + * @param [in] type Container type (see KRB5_AUTHDATA macros) + * @param [in] authdata List of authorization data to be encoded + * @param [out] container List of encoded authorization data + * + * The result is returned in @a container as a single-element list. + * + * @sa krb5_decode_authdata_container() + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_encode_authdata_container(krb5_context context, + krb5_authdatatype type, + krb5_authdata * const*authdata, + krb5_authdata ***container); + +/* + * AD-KDCIssued + */ +/** + * Encode and sign AD-KDCIssued authorization data. + * + * @param [in] context Library context + * @param [in] key Session key + * @param [in] issuer The name of the issuing principal + * @param [in] authdata List of authorization data to be signed + * @param [out] ad_kdcissued List containing AD-KDCIssued authdata + * + * This function wraps a list of authorization data entries @a authdata in an + * AD-KDCIssued container (see RFC 4120 section 5.2.6.2) signed with @a key. + * The result is returned in @a ad_kdcissued as a single-element list. + */ +krb5_error_code KRB5_CALLCONV +krb5_make_authdata_kdc_issued(krb5_context context, + const krb5_keyblock *key, + krb5_const_principal issuer, + krb5_authdata *const *authdata, + krb5_authdata ***ad_kdcissued); + +/** + * Unwrap and verify AD-KDCIssued authorization data. + * + * @param [in] context Library context + * @param [in] key Session key + * @param [in] ad_kdcissued AD-KDCIssued authorization data to be unwrapped + * @param [out] issuer Name of issuing principal (or NULL) + * @param [out] authdata Unwrapped list of authorization data + * + * This function unwraps an AD-KDCIssued authdatum (see RFC 4120 section + * 5.2.6.2) and verifies its signature against @a key. The issuer field of the + * authdatum element is returned in @a issuer, and the unwrapped list of + * authdata is returned in @a authdata. + */ +krb5_error_code KRB5_CALLCONV +krb5_verify_authdata_kdc_issued(krb5_context context, + const krb5_keyblock *key, + const krb5_authdata *ad_kdcissued, + krb5_principal *issuer, + krb5_authdata ***authdata); + +/* + * Windows PAC + */ + +/* Microsoft defined types of data */ +#define KRB5_PAC_LOGON_INFO 1 /**< Logon information */ +#define KRB5_PAC_CREDENTIALS_INFO 2 /**< Credentials information */ +#define KRB5_PAC_SERVER_CHECKSUM 6 /**< Server checksum */ +#define KRB5_PAC_PRIVSVR_CHECKSUM 7 /**< KDC checksum */ +#define KRB5_PAC_CLIENT_INFO 10 /**< Client name and ticket info */ +#define KRB5_PAC_DELEGATION_INFO 11 /**< Constrained delegation info */ +#define KRB5_PAC_UPN_DNS_INFO 12 /**< User principal name and DNS info */ +#define KRB5_PAC_CLIENT_CLAIMS 13 /**< Client claims information */ +#define KRB5_PAC_DEVICE_INFO 14 /**< Device information */ +#define KRB5_PAC_DEVICE_CLAIMS 15 /**< Device claims information */ +#define KRB5_PAC_TICKET_CHECKSUM 16 /**< Ticket checksum */ +#define KRB5_PAC_ATTRIBUTES_INFO 17 /**< PAC attributes */ +#define KRB5_PAC_REQUESTOR 18 /**< PAC requestor SID */ +#define KRB5_PAC_FULL_CHECKSUM 19 /**< KDC full checksum */ + +struct krb5_pac_data; +/** PAC data structure to convey authorization information */ +typedef struct krb5_pac_data *krb5_pac; + +/** + * Add a buffer to a PAC handle. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [in] type Buffer type + * @param [in] data contents + * + * This function adds a buffer of type @a type and contents @a data to @a pac + * if there isn't already a buffer of this type present. + * + * The valid values of @a type is one of the following: + * @li #KRB5_PAC_LOGON_INFO - Logon information + * @li #KRB5_PAC_CREDENTIALS_INFO - Credentials information + * @li #KRB5_PAC_SERVER_CHECKSUM - Server checksum + * @li #KRB5_PAC_PRIVSVR_CHECKSUM - KDC checksum + * @li #KRB5_PAC_CLIENT_INFO - Client name and ticket information + * @li #KRB5_PAC_DELEGATION_INFO - Constrained delegation information + * @li #KRB5_PAC_UPN_DNS_INFO - User principal name and DNS information + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_add_buffer(krb5_context context, krb5_pac pac, krb5_ui_4 type, + const krb5_data *data); + +/** + * Free a PAC handle. + * + * @param [in] context Library context + * @param [in] pac PAC to be freed + * + * This function frees the contents of @a pac and the structure itself. + */ +void KRB5_CALLCONV +krb5_pac_free(krb5_context context, krb5_pac pac); + +/** + * Retrieve a buffer value from a PAC. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [in] type Type of buffer to retrieve + * @param [out] data Buffer value + * + * Use krb5_free_data_contents() to free @a data when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_get_buffer(krb5_context context, krb5_pac pac, krb5_ui_4 type, + krb5_data *data); + +/** + * Return an array of buffer types in a PAC handle. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [out] len Number of entries in @a types + * @param [out] types Array of buffer types + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_get_types(krb5_context context, krb5_pac pac, size_t *len, + krb5_ui_4 **types); + +/** + * Create an empty Privilege Attribute Certificate (PAC) handle. + * + * @param [in] context Library context + * @param [out] pac New PAC handle + * + * Use krb5_pac_free() to free @a pac when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_init(krb5_context context, krb5_pac *pac); + +/** + * Unparse an encoded PAC into a new handle. + * + * @param [in] context Library context + * @param [in] ptr PAC buffer + * @param [in] len Length of @a ptr + * @param [out] pac PAC handle + * + * Use krb5_pac_free() to free @a pac when it is no longer needed. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_parse(krb5_context context, const void *ptr, size_t len, + krb5_pac *pac); + +/** + * Verify a PAC. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [in] authtime Expected timestamp + * @param [in] principal Expected principal name (or NULL) + * @param [in] server Key to validate server checksum (or NULL) + * @param [in] privsvr Key to validate KDC checksum (or NULL) + * + * This function validates @a pac against the supplied @a server, @a privsvr, + * @a principal and @a authtime. If @a principal is NULL, the principal and + * authtime are not verified. If @a server or @a privsvr is NULL, the + * corresponding checksum is not verified. + * + * If successful, @a pac is marked as verified. + * + * @note A checksum mismatch can occur if the PAC was copied from a cross-realm + * TGT by an ignorant KDC; also macOS Server Open Directory (as of 10.6) + * generates PACs with no server checksum at all. One should consider not + * failing the whole authentication because of this reason, but, instead, + * treating the ticket as if it did not contain a PAC or marking the PAC + * information as non-verified. + * + * @retval 0 Success; otherwise - Kerberos error codes + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_verify(krb5_context context, const krb5_pac pac, + krb5_timestamp authtime, krb5_const_principal principal, + const krb5_keyblock *server, const krb5_keyblock *privsvr); + +/** + * Verify a PAC, possibly from a specified realm. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [in] authtime Expected timestamp + * @param [in] principal Expected principal name (or NULL) + * @param [in] server Key to validate server checksum (or NULL) + * @param [in] privsvr Key to validate KDC checksum (or NULL) + * @param [in] with_realm If true, expect the realm of @a principal + * + * This function is similar to krb5_pac_verify(), but adds a parameter + * @a with_realm. If @a with_realm is true, the PAC_CLIENT_INFO field is + * expected to include the realm of @a principal as well as the name. This + * flag is necessary to verify PACs in cross-realm S4U2Self referral TGTs. + * + * @version New in 1.17 + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_verify_ext(krb5_context context, const krb5_pac pac, + krb5_timestamp authtime, krb5_const_principal principal, + const krb5_keyblock *server, const krb5_keyblock *privsvr, + krb5_boolean with_realm); + +/** + * Verify a PAC, possibly including ticket signature + * + * @param [in] context Library context + * @param [in] enc_tkt Ticket enc-part, possibly containing a PAC + * @param [in] server_princ Canonicalized name of ticket server + * @param [in] server Key to validate server checksum (or NULL) + * @param [in] privsvr Key to validate KDC checksum (or NULL) + * @param [out] pac_out Verified PAC (NULL if no PAC included) + * + * If a PAC is present in @a enc_tkt, verify its signatures. If @a privsvr is + * not NULL and @a server_princ is not a krbtgt or kadmin/changepw service, + * require a ticket signature over @a enc_tkt in addition to the KDC signature. + * Place the verified PAC in @a pac_out. If an invalid PAC signature is found, + * return an error matching the Windows KDC protocol code for that condition as + * closely as possible. + * + * If no PAC is present in @a enc_tkt, set @a pac_out to NULL and return + * successfully. + * + * @note This function does not validate the PAC_CLIENT_INFO buffer. If a + * specific value is expected, the caller can make a separate call to + * krb5_pac_verify_ext() with a principal but no keys. + * + * @retval 0 Success; otherwise - Kerberos error codes + * + * @version New in 1.20 + */ +krb5_error_code KRB5_CALLCONV +krb5_kdc_verify_ticket(krb5_context context, const krb5_enc_tkt_part *enc_tkt, + krb5_const_principal server_princ, + const krb5_keyblock *server, + const krb5_keyblock *privsvr, krb5_pac *pac_out); + +/** @deprecated Use krb5_kdc_sign_ticket() instead. */ +krb5_error_code KRB5_CALLCONV +krb5_pac_sign(krb5_context context, krb5_pac pac, krb5_timestamp authtime, + krb5_const_principal principal, const krb5_keyblock *server_key, + const krb5_keyblock *privsvr_key, krb5_data *data); + +/** @deprecated Use krb5_kdc_sign_ticket() instead. */ +krb5_error_code KRB5_CALLCONV +krb5_pac_sign_ext(krb5_context context, krb5_pac pac, krb5_timestamp authtime, + krb5_const_principal principal, + const krb5_keyblock *server_key, + const krb5_keyblock *privsvr_key, krb5_boolean with_realm, + krb5_data *data); + +/** + * Sign a PAC, possibly including a ticket signature + * + * @param [in] context Library context + * @param [in] enc_tkt The ticket for the signature + * @param [in] pac PAC handle + * @param [in] server_princ Canonical ticket server name + * @param [in] client_princ PAC_CLIENT_INFO principal (or NULL) + * @param [in] server Key for server checksum + * @param [in] privsvr Key for KDC and ticket checksum + * @param [in] with_realm If true, include the realm of @a principal + * + * Sign @a pac using the keys @a server and @a privsvr. Include a ticket + * signature over @a enc_tkt if @a server_princ is not a TGS or kadmin/changepw + * principal name. Add the signed PAC's encoding to the authorization data of + * @a enc_tkt in the first slot, wrapped in an AD-IF-RELEVANT container. If @a + * client_princ is non-null, add a PAC_CLIENT_INFO buffer, including the realm + * if @a with_realm is true. + * + * @retval 0 on success, otherwise - Kerberos error codes + * + * @version New in 1.20 + */ +krb5_error_code KRB5_CALLCONV +krb5_kdc_sign_ticket(krb5_context context, krb5_enc_tkt_part *enc_tkt, + const krb5_pac pac, krb5_const_principal server_princ, + krb5_const_principal client_princ, + const krb5_keyblock *server, const krb5_keyblock *privsvr, + krb5_boolean with_realm); + +/** + * Read client information from a PAC. + * + * @param [in] context Library context + * @param [in] pac PAC handle + * @param [out] authtime_out Authentication timestamp (NULL if not needed) + * @param [out] princname_out Client account name + * + * Read the PAC_CLIENT_INFO buffer in @a pac. Place the client account name as + * a string in @a princname_out. If @a authtime_out is not NULL, place the + * initial authentication timestamp in @a authtime_out. + * + * @retval 0 on success, ENOENT if no PAC_CLIENT_INFO buffer is present in @a + * pac, ERANGE if the buffer contains invalid lengths. + * + * @version New in 1.18 + */ +krb5_error_code KRB5_CALLCONV +krb5_pac_get_client_info(krb5_context context, const krb5_pac pac, + krb5_timestamp *authtime_out, char **princname_out); + +/** + * Allow the application to override the profile's allow_weak_crypto setting. + * + * @param [in] context Library context + * @param [in] enable Boolean flag + * + * This function allows an application to override the allow_weak_crypto + * setting. It is primarily for use by aklog. + * + * @retval 0 (always) + */ +krb5_error_code KRB5_CALLCONV +krb5_allow_weak_crypto(krb5_context context, krb5_boolean enable); + +/** + * A wrapper for passing information to a @c krb5_trace_callback. + * + * Currently, it only contains the formatted message as determined + * the the format string and arguments of the tracing macro, but it + * may be extended to contain more fields in the future. + */ +typedef struct _krb5_trace_info { + const char *message; +} krb5_trace_info; + +typedef void +(KRB5_CALLCONV *krb5_trace_callback)(krb5_context context, + const krb5_trace_info *info, + void *cb_data); + +/** + * Specify a callback function for trace events. + * + * @param [in] context Library context + * @param [in] fn Callback function + * @param [in] cb_data Callback data + * + * Specify a callback for trace events occurring in krb5 operations performed + * within @a context. @a fn will be invoked with @a context as the first + * argument, @a cb_data as the last argument, and a pointer to a + * krb5_trace_info as the second argument. If the trace callback is reset via + * this function or @a context is destroyed, @a fn will be invoked with a NULL + * second argument so it can clean up @a cb_data. Supply a NULL value for @a + * fn to disable trace callbacks within @a context. + * + * @note This function overrides the information passed through the + * @a KRB5_TRACE environment variable. + * + * @version New in 1.9 + * + * @return Returns KRB5_TRACE_NOSUPP if tracing is not supported in the library + * (unless @a fn is NULL). + */ +krb5_error_code KRB5_CALLCONV +krb5_set_trace_callback(krb5_context context, krb5_trace_callback fn, + void *cb_data); + +/** + * Specify a file name for directing trace events. + * + * @param [in] context Library context + * @param [in] filename File name + * + * Open @a filename for appending (creating it, if necessary) and set up a + * callback to write trace events to it. + * + * @note This function overrides the information passed through the + * @a KRB5_TRACE environment variable. + * + * @version New in 1.9 + * + * @retval KRB5_TRACE_NOSUPP Tracing is not supported in the library. + */ +krb5_error_code KRB5_CALLCONV +krb5_set_trace_filename(krb5_context context, const char *filename); + + +/** + * Hook function for inspecting or modifying messages sent to KDCs. + * + * @param [in] context Library context + * @param [in] data Callback data + * @param [in] realm The realm the message will be sent to + * @param [in] message The original message to be sent to the KDC + * @param [out] new_message_out Optional replacement message to be sent + * @param [out] new_reply_out Optional synthetic reply + * + * If the hook function returns an error code, the KDC communication will be + * aborted and the error code will be returned to the library operation which + * initiated the communication. + * + * If the hook function sets @a new_reply_out, @a message will not be sent to + * the KDC, and the given reply will used instead. + * + * If the hook function sets @a new_message_out, the given message will be sent + * to the KDC in place of @a message. + * + * If the hook function returns successfully without setting either output, + * @a message will be sent to the KDC normally. + * + * The hook function should use krb5_copy_data() to construct the value for + * @a new_message_out or @a reply_out, to ensure that it can be freed correctly + * by the library. + * + * @version New in 1.15 + * + * @retval 0 Success + * @return A Kerberos error code + */ +typedef krb5_error_code +(KRB5_CALLCONV *krb5_pre_send_fn)(krb5_context context, void *data, + const krb5_data *realm, + const krb5_data *message, + krb5_data **new_message_out, + krb5_data **new_reply_out); + +/** + * Hook function for inspecting or overriding KDC replies. + * + * @param [in] context Library context + * @param [in] data Callback data + * @param [in] code Status of KDC communication + * @param [in] realm The realm the reply was received from + * @param [in] message The message sent to the realm's KDC + * @param [in] reply The reply received from the KDC + * @param [out] new_reply_out Optional replacement reply + * + * If @a code is zero, @a reply contains the reply received from the KDC. The + * hook function may return an error code to simulate an error, may synthesize + * a different reply by setting @a new_reply_out, or may simply return + * successfully to do nothing. + * + * If @a code is non-zero, KDC communication failed and @a reply should be + * ignored. The hook function may return @a code or a different error code, or + * may synthesize a reply by setting @a new_reply_out and return successfully. + * + * The hook function should use krb5_copy_data() to construct the value for + * @a new_reply_out, to ensure that it can be freed correctly by the library. + * + * @version New in 1.15 + * + * @retval 0 Success + * @return A Kerberos error code + */ +typedef krb5_error_code +(KRB5_CALLCONV *krb5_post_recv_fn)(krb5_context context, void *data, + krb5_error_code code, + const krb5_data *realm, + const krb5_data *message, + const krb5_data *reply, + krb5_data **new_reply_out); + +/** + * Set a KDC pre-send hook function. + * + * @param [in] context Library context + * @param [in] send_hook Hook function (or NULL to disable the hook) + * @param [in] data Callback data to be passed to @a send_hook + * + * @a send_hook will be called before messages are sent to KDCs by library + * functions such as krb5_get_credentials(). The hook function may inspect, + * override, or synthesize its own reply to the message. + * + * @version New in 1.15 + */ +void KRB5_CALLCONV +krb5_set_kdc_send_hook(krb5_context context, krb5_pre_send_fn send_hook, + void *data); + +/** + * Set a KDC post-receive hook function. + * + * @param [in] context The library context. + * @param [in] recv_hook Hook function (or NULL to disable the hook) + * @param [in] data Callback data to be passed to @a recv_hook + * + * @a recv_hook will be called after a reply is received from a KDC during a + * call to a library function such as krb5_get_credentials(). The hook + * function may inspect or override the reply. This hook will not be executed + * if the pre-send hook returns a synthetic reply. + * + * @version New in 1.15 + */ +void KRB5_CALLCONV +krb5_set_kdc_recv_hook(krb5_context context, krb5_post_recv_fn recv_hook, + void *data); + +#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__)) +#pragma pack(pop) +#endif + +KRB5INT_END_DECLS + +/* Don't use this! We're going to phase it out. It's just here to keep + applications from breaking right away. */ +#define krb5_const const + +#undef KRB5_ATTR_DEPRECATED + +#endif /* KRB5_GENERAL__ */ +/* + * et-h-krb5_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB5KDC_ERR_NONE (-1765328384L) +#define KRB5KDC_ERR_NAME_EXP (-1765328383L) +#define KRB5KDC_ERR_SERVICE_EXP (-1765328382L) +#define KRB5KDC_ERR_BAD_PVNO (-1765328381L) +#define KRB5KDC_ERR_C_OLD_MAST_KVNO (-1765328380L) +#define KRB5KDC_ERR_S_OLD_MAST_KVNO (-1765328379L) +#define KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN (-1765328378L) +#define KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN (-1765328377L) +#define KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE (-1765328376L) +#define KRB5KDC_ERR_NULL_KEY (-1765328375L) +#define KRB5KDC_ERR_CANNOT_POSTDATE (-1765328374L) +#define KRB5KDC_ERR_NEVER_VALID (-1765328373L) +#define KRB5KDC_ERR_POLICY (-1765328372L) +#define KRB5KDC_ERR_BADOPTION (-1765328371L) +#define KRB5KDC_ERR_ETYPE_NOSUPP (-1765328370L) +#define KRB5KDC_ERR_SUMTYPE_NOSUPP (-1765328369L) +#define KRB5KDC_ERR_PADATA_TYPE_NOSUPP (-1765328368L) +#define KRB5KDC_ERR_TRTYPE_NOSUPP (-1765328367L) +#define KRB5KDC_ERR_CLIENT_REVOKED (-1765328366L) +#define KRB5KDC_ERR_SERVICE_REVOKED (-1765328365L) +#define KRB5KDC_ERR_TGT_REVOKED (-1765328364L) +#define KRB5KDC_ERR_CLIENT_NOTYET (-1765328363L) +#define KRB5KDC_ERR_SERVICE_NOTYET (-1765328362L) +#define KRB5KDC_ERR_KEY_EXP (-1765328361L) +#define KRB5KDC_ERR_PREAUTH_FAILED (-1765328360L) +#define KRB5KDC_ERR_PREAUTH_REQUIRED (-1765328359L) +#define KRB5KDC_ERR_SERVER_NOMATCH (-1765328358L) +#define KRB5KDC_ERR_MUST_USE_USER2USER (-1765328357L) +#define KRB5KDC_ERR_PATH_NOT_ACCEPTED (-1765328356L) +#define KRB5KDC_ERR_SVC_UNAVAILABLE (-1765328355L) +#define KRB5PLACEHOLD_30 (-1765328354L) +#define KRB5KRB_AP_ERR_BAD_INTEGRITY (-1765328353L) +#define KRB5KRB_AP_ERR_TKT_EXPIRED (-1765328352L) +#define KRB5KRB_AP_ERR_TKT_NYV (-1765328351L) +#define KRB5KRB_AP_ERR_REPEAT (-1765328350L) +#define KRB5KRB_AP_ERR_NOT_US (-1765328349L) +#define KRB5KRB_AP_ERR_BADMATCH (-1765328348L) +#define KRB5KRB_AP_ERR_SKEW (-1765328347L) +#define KRB5KRB_AP_ERR_BADADDR (-1765328346L) +#define KRB5KRB_AP_ERR_BADVERSION (-1765328345L) +#define KRB5KRB_AP_ERR_MSG_TYPE (-1765328344L) +#define KRB5KRB_AP_ERR_MODIFIED (-1765328343L) +#define KRB5KRB_AP_ERR_BADORDER (-1765328342L) +#define KRB5KRB_AP_ERR_ILL_CR_TKT (-1765328341L) +#define KRB5KRB_AP_ERR_BADKEYVER (-1765328340L) +#define KRB5KRB_AP_ERR_NOKEY (-1765328339L) +#define KRB5KRB_AP_ERR_MUT_FAIL (-1765328338L) +#define KRB5KRB_AP_ERR_BADDIRECTION (-1765328337L) +#define KRB5KRB_AP_ERR_METHOD (-1765328336L) +#define KRB5KRB_AP_ERR_BADSEQ (-1765328335L) +#define KRB5KRB_AP_ERR_INAPP_CKSUM (-1765328334L) +#define KRB5KRB_AP_PATH_NOT_ACCEPTED (-1765328333L) +#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) +#define KRB5PLACEHOLD_53 (-1765328331L) +#define KRB5PLACEHOLD_54 (-1765328330L) +#define KRB5PLACEHOLD_55 (-1765328329L) +#define KRB5PLACEHOLD_56 (-1765328328L) +#define KRB5PLACEHOLD_57 (-1765328327L) +#define KRB5PLACEHOLD_58 (-1765328326L) +#define KRB5PLACEHOLD_59 (-1765328325L) +#define KRB5KRB_ERR_GENERIC (-1765328324L) +#define KRB5KRB_ERR_FIELD_TOOLONG (-1765328323L) +#define KRB5KDC_ERR_CLIENT_NOT_TRUSTED (-1765328322L) +#define KRB5KDC_ERR_KDC_NOT_TRUSTED (-1765328321L) +#define KRB5KDC_ERR_INVALID_SIG (-1765328320L) +#define KRB5KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED (-1765328319L) +#define KRB5KDC_ERR_CERTIFICATE_MISMATCH (-1765328318L) +#define KRB5KRB_AP_ERR_NO_TGT (-1765328317L) +#define KRB5KDC_ERR_WRONG_REALM (-1765328316L) +#define KRB5KRB_AP_ERR_USER_TO_USER_REQUIRED (-1765328315L) +#define KRB5KDC_ERR_CANT_VERIFY_CERTIFICATE (-1765328314L) +#define KRB5KDC_ERR_INVALID_CERTIFICATE (-1765328313L) +#define KRB5KDC_ERR_REVOKED_CERTIFICATE (-1765328312L) +#define KRB5KDC_ERR_REVOCATION_STATUS_UNKNOWN (-1765328311L) +#define KRB5KDC_ERR_REVOCATION_STATUS_UNAVAILABLE (-1765328310L) +#define KRB5KDC_ERR_CLIENT_NAME_MISMATCH (-1765328309L) +#define KRB5KDC_ERR_KDC_NAME_MISMATCH (-1765328308L) +#define KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE (-1765328307L) +#define KRB5KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED (-1765328306L) +#define KRB5KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED (-1765328305L) +#define KRB5KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED (-1765328304L) +#define KRB5KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED (-1765328303L) +#define KRB5PLACEHOLD_82 (-1765328302L) +#define KRB5PLACEHOLD_83 (-1765328301L) +#define KRB5PLACEHOLD_84 (-1765328300L) +#define KRB5KRB_AP_ERR_IAKERB_KDC_NOT_FOUND (-1765328299L) +#define KRB5KRB_AP_ERR_IAKERB_KDC_NO_RESPONSE (-1765328298L) +#define KRB5PLACEHOLD_87 (-1765328297L) +#define KRB5PLACEHOLD_88 (-1765328296L) +#define KRB5PLACEHOLD_89 (-1765328295L) +#define KRB5KDC_ERR_PREAUTH_EXPIRED (-1765328294L) +#define KRB5KDC_ERR_MORE_PREAUTH_DATA_REQUIRED (-1765328293L) +#define KRB5PLACEHOLD_92 (-1765328292L) +#define KRB5KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTION (-1765328291L) +#define KRB5PLACEHOLD_94 (-1765328290L) +#define KRB5PLACEHOLD_95 (-1765328289L) +#define KRB5PLACEHOLD_96 (-1765328288L) +#define KRB5PLACEHOLD_97 (-1765328287L) +#define KRB5PLACEHOLD_98 (-1765328286L) +#define KRB5PLACEHOLD_99 (-1765328285L) +#define KRB5KDC_ERR_NO_ACCEPTABLE_KDF (-1765328284L) +#define KRB5PLACEHOLD_101 (-1765328283L) +#define KRB5PLACEHOLD_102 (-1765328282L) +#define KRB5PLACEHOLD_103 (-1765328281L) +#define KRB5PLACEHOLD_104 (-1765328280L) +#define KRB5PLACEHOLD_105 (-1765328279L) +#define KRB5PLACEHOLD_106 (-1765328278L) +#define KRB5PLACEHOLD_107 (-1765328277L) +#define KRB5PLACEHOLD_108 (-1765328276L) +#define KRB5PLACEHOLD_109 (-1765328275L) +#define KRB5PLACEHOLD_110 (-1765328274L) +#define KRB5PLACEHOLD_111 (-1765328273L) +#define KRB5PLACEHOLD_112 (-1765328272L) +#define KRB5PLACEHOLD_113 (-1765328271L) +#define KRB5PLACEHOLD_114 (-1765328270L) +#define KRB5PLACEHOLD_115 (-1765328269L) +#define KRB5PLACEHOLD_116 (-1765328268L) +#define KRB5PLACEHOLD_117 (-1765328267L) +#define KRB5PLACEHOLD_118 (-1765328266L) +#define KRB5PLACEHOLD_119 (-1765328265L) +#define KRB5PLACEHOLD_120 (-1765328264L) +#define KRB5PLACEHOLD_121 (-1765328263L) +#define KRB5PLACEHOLD_122 (-1765328262L) +#define KRB5PLACEHOLD_123 (-1765328261L) +#define KRB5PLACEHOLD_124 (-1765328260L) +#define KRB5PLACEHOLD_125 (-1765328259L) +#define KRB5PLACEHOLD_126 (-1765328258L) +#define KRB5PLACEHOLD_127 (-1765328257L) +#define KRB5_ERR_RCSID (-1765328256L) +#define KRB5_LIBOS_BADLOCKFLAG (-1765328255L) +#define KRB5_LIBOS_CANTREADPWD (-1765328254L) +#define KRB5_LIBOS_BADPWDMATCH (-1765328253L) +#define KRB5_LIBOS_PWDINTR (-1765328252L) +#define KRB5_PARSE_ILLCHAR (-1765328251L) +#define KRB5_PARSE_MALFORMED (-1765328250L) +#define KRB5_CONFIG_CANTOPEN (-1765328249L) +#define KRB5_CONFIG_BADFORMAT (-1765328248L) +#define KRB5_CONFIG_NOTENUFSPACE (-1765328247L) +#define KRB5_BADMSGTYPE (-1765328246L) +#define KRB5_CC_BADNAME (-1765328245L) +#define KRB5_CC_UNKNOWN_TYPE (-1765328244L) +#define KRB5_CC_NOTFOUND (-1765328243L) +#define KRB5_CC_END (-1765328242L) +#define KRB5_NO_TKT_SUPPLIED (-1765328241L) +#define KRB5KRB_AP_WRONG_PRINC (-1765328240L) +#define KRB5KRB_AP_ERR_TKT_INVALID (-1765328239L) +#define KRB5_PRINC_NOMATCH (-1765328238L) +#define KRB5_KDCREP_MODIFIED (-1765328237L) +#define KRB5_KDCREP_SKEW (-1765328236L) +#define KRB5_IN_TKT_REALM_MISMATCH (-1765328235L) +#define KRB5_PROG_ETYPE_NOSUPP (-1765328234L) +#define KRB5_PROG_KEYTYPE_NOSUPP (-1765328233L) +#define KRB5_WRONG_ETYPE (-1765328232L) +#define KRB5_PROG_SUMTYPE_NOSUPP (-1765328231L) +#define KRB5_REALM_UNKNOWN (-1765328230L) +#define KRB5_SERVICE_UNKNOWN (-1765328229L) +#define KRB5_KDC_UNREACH (-1765328228L) +#define KRB5_NO_LOCALNAME (-1765328227L) +#define KRB5_MUTUAL_FAILED (-1765328226L) +#define KRB5_RC_TYPE_EXISTS (-1765328225L) +#define KRB5_RC_MALLOC (-1765328224L) +#define KRB5_RC_TYPE_NOTFOUND (-1765328223L) +#define KRB5_RC_UNKNOWN (-1765328222L) +#define KRB5_RC_REPLAY (-1765328221L) +#define KRB5_RC_IO (-1765328220L) +#define KRB5_RC_NOIO (-1765328219L) +#define KRB5_RC_PARSE (-1765328218L) +#define KRB5_RC_IO_EOF (-1765328217L) +#define KRB5_RC_IO_MALLOC (-1765328216L) +#define KRB5_RC_IO_PERM (-1765328215L) +#define KRB5_RC_IO_IO (-1765328214L) +#define KRB5_RC_IO_UNKNOWN (-1765328213L) +#define KRB5_RC_IO_SPACE (-1765328212L) +#define KRB5_TRANS_CANTOPEN (-1765328211L) +#define KRB5_TRANS_BADFORMAT (-1765328210L) +#define KRB5_LNAME_CANTOPEN (-1765328209L) +#define KRB5_LNAME_NOTRANS (-1765328208L) +#define KRB5_LNAME_BADFORMAT (-1765328207L) +#define KRB5_CRYPTO_INTERNAL (-1765328206L) +#define KRB5_KT_BADNAME (-1765328205L) +#define KRB5_KT_UNKNOWN_TYPE (-1765328204L) +#define KRB5_KT_NOTFOUND (-1765328203L) +#define KRB5_KT_END (-1765328202L) +#define KRB5_KT_NOWRITE (-1765328201L) +#define KRB5_KT_IOERR (-1765328200L) +#define KRB5_NO_TKT_IN_RLM (-1765328199L) +#define KRB5DES_BAD_KEYPAR (-1765328198L) +#define KRB5DES_WEAK_KEY (-1765328197L) +#define KRB5_BAD_ENCTYPE (-1765328196L) +#define KRB5_BAD_KEYSIZE (-1765328195L) +#define KRB5_BAD_MSIZE (-1765328194L) +#define KRB5_CC_TYPE_EXISTS (-1765328193L) +#define KRB5_KT_TYPE_EXISTS (-1765328192L) +#define KRB5_CC_IO (-1765328191L) +#define KRB5_FCC_PERM (-1765328190L) +#define KRB5_FCC_NOFILE (-1765328189L) +#define KRB5_FCC_INTERNAL (-1765328188L) +#define KRB5_CC_WRITE (-1765328187L) +#define KRB5_CC_NOMEM (-1765328186L) +#define KRB5_CC_FORMAT (-1765328185L) +#define KRB5_CC_NOT_KTYPE (-1765328184L) +#define KRB5_INVALID_FLAGS (-1765328183L) +#define KRB5_NO_2ND_TKT (-1765328182L) +#define KRB5_NOCREDS_SUPPLIED (-1765328181L) +#define KRB5_SENDAUTH_BADAUTHVERS (-1765328180L) +#define KRB5_SENDAUTH_BADAPPLVERS (-1765328179L) +#define KRB5_SENDAUTH_BADRESPONSE (-1765328178L) +#define KRB5_SENDAUTH_REJECTED (-1765328177L) +#define KRB5_PREAUTH_BAD_TYPE (-1765328176L) +#define KRB5_PREAUTH_NO_KEY (-1765328175L) +#define KRB5_PREAUTH_FAILED (-1765328174L) +#define KRB5_RCACHE_BADVNO (-1765328173L) +#define KRB5_CCACHE_BADVNO (-1765328172L) +#define KRB5_KEYTAB_BADVNO (-1765328171L) +#define KRB5_PROG_ATYPE_NOSUPP (-1765328170L) +#define KRB5_RC_REQUIRED (-1765328169L) +#define KRB5_ERR_BAD_HOSTNAME (-1765328168L) +#define KRB5_ERR_HOST_REALM_UNKNOWN (-1765328167L) +#define KRB5_SNAME_UNSUPP_NAMETYPE (-1765328166L) +#define KRB5KRB_AP_ERR_V4_REPLY (-1765328165L) +#define KRB5_REALM_CANT_RESOLVE (-1765328164L) +#define KRB5_TKT_NOT_FORWARDABLE (-1765328163L) +#define KRB5_FWD_BAD_PRINCIPAL (-1765328162L) +#define KRB5_GET_IN_TKT_LOOP (-1765328161L) +#define KRB5_CONFIG_NODEFREALM (-1765328160L) +#define KRB5_SAM_UNSUPPORTED (-1765328159L) +#define KRB5_SAM_INVALID_ETYPE (-1765328158L) +#define KRB5_SAM_NO_CHECKSUM (-1765328157L) +#define KRB5_SAM_BAD_CHECKSUM (-1765328156L) +#define KRB5_KT_NAME_TOOLONG (-1765328155L) +#define KRB5_KT_KVNONOTFOUND (-1765328154L) +#define KRB5_APPL_EXPIRED (-1765328153L) +#define KRB5_LIB_EXPIRED (-1765328152L) +#define KRB5_CHPW_PWDNULL (-1765328151L) +#define KRB5_CHPW_FAIL (-1765328150L) +#define KRB5_KT_FORMAT (-1765328149L) +#define KRB5_NOPERM_ETYPE (-1765328148L) +#define KRB5_CONFIG_ETYPE_NOSUPP (-1765328147L) +#define KRB5_OBSOLETE_FN (-1765328146L) +#define KRB5_EAI_FAIL (-1765328145L) +#define KRB5_EAI_NODATA (-1765328144L) +#define KRB5_EAI_NONAME (-1765328143L) +#define KRB5_EAI_SERVICE (-1765328142L) +#define KRB5_ERR_NUMERIC_REALM (-1765328141L) +#define KRB5_ERR_BAD_S2K_PARAMS (-1765328140L) +#define KRB5_ERR_NO_SERVICE (-1765328139L) +#define KRB5_CC_READONLY (-1765328138L) +#define KRB5_CC_NOSUPP (-1765328137L) +#define KRB5_DELTAT_BADFORMAT (-1765328136L) +#define KRB5_PLUGIN_NO_HANDLE (-1765328135L) +#define KRB5_PLUGIN_OP_NOTSUPP (-1765328134L) +#define KRB5_ERR_INVALID_UTF8 (-1765328133L) +#define KRB5_ERR_FAST_REQUIRED (-1765328132L) +#define KRB5_LOCAL_ADDR_REQUIRED (-1765328131L) +#define KRB5_REMOTE_ADDR_REQUIRED (-1765328130L) +#define KRB5_TRACE_NOSUPP (-1765328129L) +#define ERROR_TABLE_BASE_krb5 (-1765328384L) + +extern const struct error_table et_krb5_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_krb5_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_krb5_error_table() +#endif + +#if !defined(_WIN32) +#define init_krb5_err_tbl initialize_krb5_error_table +#define krb5_err_base ERROR_TABLE_BASE_krb5 +#endif +/* + * et-h-k5e1_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB5_PLUGIN_VER_NOTSUPP (-1750600192L) +#define KRB5_PLUGIN_BAD_MODULE_SPEC (-1750600191L) +#define KRB5_PLUGIN_NAME_NOTFOUND (-1750600190L) +#define KRB5KDC_ERR_DISCARD (-1750600189L) +#define KRB5_DCC_CANNOT_CREATE (-1750600188L) +#define KRB5_KCC_INVALID_ANCHOR (-1750600187L) +#define KRB5_KCC_UNKNOWN_VERSION (-1750600186L) +#define KRB5_KCC_INVALID_UID (-1750600185L) +#define KRB5_KCM_MALFORMED_REPLY (-1750600184L) +#define KRB5_KCM_RPC_ERROR (-1750600183L) +#define KRB5_KCM_REPLY_TOO_BIG (-1750600182L) +#define KRB5_KCM_NO_SERVER (-1750600181L) +#define KRB5_CERTAUTH_HWAUTH (-1750600180L) +#define KRB5_CERTAUTH_HWAUTH_PASS (-1750600179L) +#define ERROR_TABLE_BASE_k5e1 (-1750600192L) + +extern const struct error_table et_k5e1_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_k5e1_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_k5e1_error_table() +#endif + +#if !defined(_WIN32) +#define init_k5e1_err_tbl initialize_k5e1_error_table +#define k5e1_err_base ERROR_TABLE_BASE_k5e1 +#endif +/* + * et-h-kdb5_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB5_KDB_RCSID (-1780008448L) +#define KRB5_KDB_INUSE (-1780008447L) +#define KRB5_KDB_UK_SERROR (-1780008446L) +#define KRB5_KDB_UK_RERROR (-1780008445L) +#define KRB5_KDB_UNAUTH (-1780008444L) +#define KRB5_KDB_NOENTRY (-1780008443L) +#define KRB5_KDB_ILL_WILDCARD (-1780008442L) +#define KRB5_KDB_DB_INUSE (-1780008441L) +#define KRB5_KDB_DB_CHANGED (-1780008440L) +#define KRB5_KDB_TRUNCATED_RECORD (-1780008439L) +#define KRB5_KDB_RECURSIVELOCK (-1780008438L) +#define KRB5_KDB_NOTLOCKED (-1780008437L) +#define KRB5_KDB_BADLOCKMODE (-1780008436L) +#define KRB5_KDB_DBNOTINITED (-1780008435L) +#define KRB5_KDB_DBINITED (-1780008434L) +#define KRB5_KDB_ILLDIRECTION (-1780008433L) +#define KRB5_KDB_NOMASTERKEY (-1780008432L) +#define KRB5_KDB_BADMASTERKEY (-1780008431L) +#define KRB5_KDB_INVALIDKEYSIZE (-1780008430L) +#define KRB5_KDB_CANTREAD_STORED (-1780008429L) +#define KRB5_KDB_BADSTORED_MKEY (-1780008428L) +#define KRB5_KDB_NOACTMASTERKEY (-1780008427L) +#define KRB5_KDB_KVNONOMATCH (-1780008426L) +#define KRB5_KDB_STORED_MKEY_NOTCURRENT (-1780008425L) +#define KRB5_KDB_CANTLOCK_DB (-1780008424L) +#define KRB5_KDB_DB_CORRUPT (-1780008423L) +#define KRB5_KDB_BAD_VERSION (-1780008422L) +#define KRB5_KDB_BAD_SALTTYPE (-1780008421L) +#define KRB5_KDB_BAD_ENCTYPE (-1780008420L) +#define KRB5_KDB_BAD_CREATEFLAGS (-1780008419L) +#define KRB5_KDB_NO_PERMITTED_KEY (-1780008418L) +#define KRB5_KDB_NO_MATCHING_KEY (-1780008417L) +#define KRB5_KDB_DBTYPE_NOTFOUND (-1780008416L) +#define KRB5_KDB_DBTYPE_NOSUP (-1780008415L) +#define KRB5_KDB_DBTYPE_INIT (-1780008414L) +#define KRB5_KDB_SERVER_INTERNAL_ERR (-1780008413L) +#define KRB5_KDB_ACCESS_ERROR (-1780008412L) +#define KRB5_KDB_INTERNAL_ERROR (-1780008411L) +#define KRB5_KDB_CONSTRAINT_VIOLATION (-1780008410L) +#define KRB5_LOG_CONV (-1780008409L) +#define KRB5_LOG_UNSTABLE (-1780008408L) +#define KRB5_LOG_CORRUPT (-1780008407L) +#define KRB5_LOG_ERROR (-1780008406L) +#define KRB5_KDB_DBTYPE_MISMATCH (-1780008405L) +#define KRB5_KDB_POLICY_REF (-1780008404L) +#define KRB5_KDB_STRINGS_TOOLONG (-1780008403L) +#define KRB5_KDB_ALIAS_UNSUPPORTED (-1780008402L) +#define ERROR_TABLE_BASE_kdb5 (-1780008448L) + +extern const struct error_table et_kdb5_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_kdb5_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_kdb5_error_table() +#endif + +#if !defined(_WIN32) +#define init_kdb5_err_tbl initialize_kdb5_error_table +#define kdb5_err_base ERROR_TABLE_BASE_kdb5 +#endif +/* + * et-h-kv5m_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KV5M_NONE (-1760647424L) +#define KV5M_PRINCIPAL (-1760647423L) +#define KV5M_DATA (-1760647422L) +#define KV5M_KEYBLOCK (-1760647421L) +#define KV5M_CHECKSUM (-1760647420L) +#define KV5M_ENCRYPT_BLOCK (-1760647419L) +#define KV5M_ENC_DATA (-1760647418L) +#define KV5M_CRYPTOSYSTEM_ENTRY (-1760647417L) +#define KV5M_CS_TABLE_ENTRY (-1760647416L) +#define KV5M_CHECKSUM_ENTRY (-1760647415L) +#define KV5M_AUTHDATA (-1760647414L) +#define KV5M_TRANSITED (-1760647413L) +#define KV5M_ENC_TKT_PART (-1760647412L) +#define KV5M_TICKET (-1760647411L) +#define KV5M_AUTHENTICATOR (-1760647410L) +#define KV5M_TKT_AUTHENT (-1760647409L) +#define KV5M_CREDS (-1760647408L) +#define KV5M_LAST_REQ_ENTRY (-1760647407L) +#define KV5M_PA_DATA (-1760647406L) +#define KV5M_KDC_REQ (-1760647405L) +#define KV5M_ENC_KDC_REP_PART (-1760647404L) +#define KV5M_KDC_REP (-1760647403L) +#define KV5M_ERROR (-1760647402L) +#define KV5M_AP_REQ (-1760647401L) +#define KV5M_AP_REP (-1760647400L) +#define KV5M_AP_REP_ENC_PART (-1760647399L) +#define KV5M_RESPONSE (-1760647398L) +#define KV5M_SAFE (-1760647397L) +#define KV5M_PRIV (-1760647396L) +#define KV5M_PRIV_ENC_PART (-1760647395L) +#define KV5M_CRED (-1760647394L) +#define KV5M_CRED_INFO (-1760647393L) +#define KV5M_CRED_ENC_PART (-1760647392L) +#define KV5M_PWD_DATA (-1760647391L) +#define KV5M_ADDRESS (-1760647390L) +#define KV5M_KEYTAB_ENTRY (-1760647389L) +#define KV5M_CONTEXT (-1760647388L) +#define KV5M_OS_CONTEXT (-1760647387L) +#define KV5M_ALT_METHOD (-1760647386L) +#define KV5M_ETYPE_INFO_ENTRY (-1760647385L) +#define KV5M_DB_CONTEXT (-1760647384L) +#define KV5M_AUTH_CONTEXT (-1760647383L) +#define KV5M_KEYTAB (-1760647382L) +#define KV5M_RCACHE (-1760647381L) +#define KV5M_CCACHE (-1760647380L) +#define KV5M_PREAUTH_OPS (-1760647379L) +#define KV5M_SAM_CHALLENGE (-1760647378L) +#define KV5M_SAM_CHALLENGE_2 (-1760647377L) +#define KV5M_SAM_KEY (-1760647376L) +#define KV5M_ENC_SAM_RESPONSE_ENC (-1760647375L) +#define KV5M_ENC_SAM_RESPONSE_ENC_2 (-1760647374L) +#define KV5M_SAM_RESPONSE (-1760647373L) +#define KV5M_SAM_RESPONSE_2 (-1760647372L) +#define KV5M_PREDICTED_SAM_RESPONSE (-1760647371L) +#define KV5M_PASSWD_PHRASE_ELEMENT (-1760647370L) +#define KV5M_GSS_OID (-1760647369L) +#define KV5M_GSS_QUEUE (-1760647368L) +#define KV5M_FAST_ARMORED_REQ (-1760647367L) +#define KV5M_FAST_REQ (-1760647366L) +#define KV5M_FAST_RESPONSE (-1760647365L) +#define KV5M_AUTHDATA_CONTEXT (-1760647364L) +#define ERROR_TABLE_BASE_kv5m (-1760647424L) + +extern const struct error_table et_kv5m_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_kv5m_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_kv5m_error_table() +#endif + +#if !defined(_WIN32) +#define init_kv5m_err_tbl initialize_kv5m_error_table +#define kv5m_err_base ERROR_TABLE_BASE_kv5m +#endif +/* + * et-h-krb524_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB524_BADKEY (-1750206208L) +#define KRB524_BADADDR (-1750206207L) +#define KRB524_BADPRINC (-1750206206L) +#define KRB524_BADREALM (-1750206205L) +#define KRB524_V4ERR (-1750206204L) +#define KRB524_ENCFULL (-1750206203L) +#define KRB524_DECEMPTY (-1750206202L) +#define KRB524_NOTRESP (-1750206201L) +#define KRB524_KRB4_DISABLED (-1750206200L) +#define ERROR_TABLE_BASE_k524 (-1750206208L) + +extern const struct error_table et_k524_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_k524_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_k524_error_table() +#endif + +#if !defined(_WIN32) +#define init_k524_err_tbl initialize_k524_error_table +#define k524_err_base ERROR_TABLE_BASE_k524 +#endif +/* + * et-h-asn1_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define ASN1_BAD_TIMEFORMAT (1859794432L) +#define ASN1_MISSING_FIELD (1859794433L) +#define ASN1_MISPLACED_FIELD (1859794434L) +#define ASN1_TYPE_MISMATCH (1859794435L) +#define ASN1_OVERFLOW (1859794436L) +#define ASN1_OVERRUN (1859794437L) +#define ASN1_BAD_ID (1859794438L) +#define ASN1_BAD_LENGTH (1859794439L) +#define ASN1_BAD_FORMAT (1859794440L) +#define ASN1_PARSE_ERROR (1859794441L) +#define ASN1_BAD_GMTIME (1859794442L) +#define ASN1_INDEF (1859794443L) +#define ASN1_MISSING_EOC (1859794444L) +#define ASN1_OMITTED (1859794445L) +#define ERROR_TABLE_BASE_asn1 (1859794432L) + +extern const struct error_table et_asn1_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_asn1_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_asn1_error_table() +#endif + +#if !defined(_WIN32) +#define init_asn1_err_tbl initialize_asn1_error_table +#define asn1_err_base ERROR_TABLE_BASE_asn1 +#endif +#endif /* KRB5_KRB5_H_INCLUDED */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/localauth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/localauth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..df7574eeaceaeb7196283780c61facd2b6419dda --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/localauth_plugin.h @@ -0,0 +1,138 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2013 by the Massachusetts Institute of Technology. + * 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. + */ + +/* + * Declarations for localauth plugin module implementors. + * + * The localauth pluggable interface currently has only one supported major + * version, which is 1. Major version 1 has a current minor version number of + * 1. + * + * Localauth plugin modules should define a function named + * localauth__initvt, matching the signature: + * + * krb5_error_code + * localauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_localauth_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_LOCALAUTH_PLUGIN_H +#define KRB5_LOCALAUTH_PLUGIN_H + +#include +#include + +/* An abstract type for localauth module data. */ +typedef struct krb5_localauth_moddata_st *krb5_localauth_moddata; + +/*** Method type declarations ***/ + +/* Optional: Initialize module data. */ +typedef krb5_error_code +(*krb5_localauth_init_fn)(krb5_context context, + krb5_localauth_moddata *data); + +/* Optional: Release resources used by module data. */ +typedef void +(*krb5_localauth_fini_fn)(krb5_context context, krb5_localauth_moddata data); + +/* + * Optional: Determine whether aname is authorized to log in as the local + * account lname. Return 0 if aname is authorized, EPERM if aname is + * authoritatively not authorized, KRB5_PLUGIN_NO_HANDLE if the module cannot + * determine whether aname is authorized, and any other error code for a + * serious failure to process the request. aname will be considered authorized + * if at least one module returns 0 and all other modules return + * KRB5_PLUGIN_NO_HANDLE. + */ +typedef krb5_error_code +(*krb5_localauth_userok_fn)(krb5_context context, krb5_localauth_moddata data, + krb5_const_principal aname, const char *lname); + +/* + * Optional (mandatory if an2ln_types is set): Determine the local account name + * corresponding to aname. Return 0 and set *lname_out if a mapping can be + * determined; the contents of *lname_out will later be released with a call to + * the module's free_string method. Return KRB5_LNAME_NOTRANS if no mapping + * can be determined. Return any other error code for a serious failure to + * process the request; this will halt the krb5_aname_to_localname operation. + * + * If the module's an2ln_types field is set, this method will only be invoked + * when a profile "auth_to_local" value references one of the module's types. + * type and residual will be set to the type and residual of the auth_to_local + * value. + * + * If the module's an2ln_types field is not set but the an2ln method is + * implemented, this method will be invoked independently of the profile's + * auth_to_local settings, with type and residual set to NULL. If multiple + * modules are registered with an2ln methods but no an2ln_types field, the + * order of invocation is not defined, but all such modules will be consulted + * before the built-in mechanisms are tried. + */ +typedef krb5_error_code +(*krb5_localauth_an2ln_fn)(krb5_context context, krb5_localauth_moddata data, + const char *type, const char *residual, + krb5_const_principal aname, char **lname_out); + +/* + * Optional (mandatory if an2ln is implemented): Release the memory returned by + * an invocation of an2ln. + */ +typedef void +(*krb5_localauth_free_string_fn)(krb5_context context, + krb5_localauth_moddata data, char *str); + +/* localauth vtable for major version 1. */ +typedef struct krb5_localauth_vtable_st { + const char *name; /* Mandatory: name of module. */ + const char **an2ln_types; /* Optional: uppercase auth_to_local types */ + krb5_localauth_init_fn init; + krb5_localauth_fini_fn fini; + krb5_localauth_userok_fn userok; + krb5_localauth_an2ln_fn an2ln; + krb5_localauth_free_string_fn free_string; + /* Minor version 1 ends here. */ +} *krb5_localauth_vtable; + +#endif /* KRB5_LOCALAUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/locate_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/locate_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..7a872a159cc103ced8023308d36cc62de45f6034 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/locate_plugin.h @@ -0,0 +1,62 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright 2006 Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* + * + * Service location plugin definitions for Kerberos 5. + */ + +#ifndef KRB5_LOCATE_PLUGIN_H_INCLUDED +#define KRB5_LOCATE_PLUGIN_H_INCLUDED +#include + +enum locate_service_type { + locate_service_kdc = 1, + locate_service_primary_kdc, + locate_service_kadmin, + locate_service_krb524, + locate_service_kpasswd +}; +#define locate_service_master_kdc locate_service_primary_kdc + +typedef struct krb5plugin_service_locate_ftable { + int minor_version; /* currently 0 */ + /* Per-context setup and teardown. Returned void* blob is + private to the plugin. */ + krb5_error_code (*init)(krb5_context, void **); + void (*fini)(void *); + /* Callback function returns non-zero if the plugin function + should quit and return; this may be because of an error, or may + indicate we've already contacted the service, whatever. The + lookup function should only return an error if it detects a + problem, not if the callback function tells it to quit. */ + krb5_error_code (*lookup)(void *, + enum locate_service_type svc, const char *realm, + int socktype, int family, + int (*cbfunc)(void *,int,struct sockaddr *), + void *cbdata); +} krb5plugin_service_locate_ftable; +/* extern krb5plugin_service_locate_ftable service_locator; */ +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..c575efa0cfee88f0c8934ac5d82515fb62dbe34c --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/plugin.h @@ -0,0 +1,46 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2010 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* Generic declarations for dynamic modules implementing krb5 plugin + * modules. */ + +#ifndef KRB5_PLUGIN_H +#define KRB5_PLUGIN_H + +/* krb5_plugin_vtable is an abstract type. Module initvt functions will cast + * it to the appropriate interface-specific vtable type. */ +typedef struct krb5_plugin_vtable_st *krb5_plugin_vtable; + +/* + * krb5_plugin_initvt_fn is the type of all module initvt functions. Based on + * the maj_ver argument, the initvt function should cast vtable to the + * appropriate type and then fill it in. If a vtable has been expanded, + * min_ver indicates which version of the vtable is being filled in. + */ +typedef krb5_error_code +(*krb5_plugin_initvt_fn)(krb5_context context, int maj_ver, int min_ver, + krb5_plugin_vtable vtable); + +#endif /* KRB5_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/preauth_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/preauth_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..cd6844634c065c333331ef56ee6ce42ec980396e --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/preauth_plugin.h @@ -0,0 +1,41 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2012 by the Massachusetts Institute of Technology. + * 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. + */ + +/* This header includes the clpreauth and kdcpreauth interface declarations, + * for backward compatibility and convenience. */ + +#ifndef KRB5_PREAUTH_PLUGIN_H +#define KRB5_PREAUTH_PLUGIN_H + +#include +#include + +#endif /* KRB5_PREAUTH_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/pwqual_plugin.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/pwqual_plugin.h new file mode 100644 index 0000000000000000000000000000000000000000..00e7df973eaeadfb854112771165c506990d8f64 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/krb5/pwqual_plugin.h @@ -0,0 +1,109 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2010 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* + * Declarations for password quality plugin module implementors. + * + * The password quality pluggable interface currently has only one supported + * major version, which is 1. Major version 1 has a current minor version + * number of 1. + * + * Password quality plugin modules should define a function named + * pwqual__initvt, matching the signature: + * + * krb5_error_code + * pwqual_modname_initvt(krb5_context context, int maj_ver, int min_ver, + * krb5_plugin_vtable vtable); + * + * The initvt function should: + * + * - Check that the supplied maj_ver number is supported by the module, or + * return KRB5_PLUGIN_VER_NOTSUPP if it is not. + * + * - Cast the vtable pointer as appropriate for maj_ver: + * maj_ver == 1: Cast to krb5_pwqual_vtable + * + * - Initialize the methods of the vtable, stopping as appropriate for the + * supplied min_ver. Optional methods may be left uninitialized. + * + * Memory for the vtable is allocated by the caller, not by the module. + */ + +#ifndef KRB5_PWQUAL_PLUGIN_H +#define KRB5_PWQUAL_PLUGIN_H + +#include +#include +#include + +/* An abstract type for password quality module data. */ +typedef struct krb5_pwqual_moddata_st *krb5_pwqual_moddata; + +/*** Method type declarations ***/ + +/* Optional: Initialize module data. dictfile is the realm's configured + * dictionary filename. */ +typedef krb5_error_code +(*krb5_pwqual_open_fn)(krb5_context context, const char *dict_file, + krb5_pwqual_moddata *data); + +/* + * Mandatory: Check a password for the principal princ, which has an associated + * password policy named policy_name (or no associated policy if policy_name is + * NULL). The parameter languages, if not NULL, contains a null-terminated + * list of client-specified language tags as defined in RFC 5646. The method + * should return one of the following errors if the password fails quality + * standards: + * + * - KADM5_PASS_Q_TOOSHORT: password should be longer + * - KADM5_PASS_Q_CLASS: password must have more character classes + * - KADM5_PASS_Q_DICT: password contains dictionary words + * - KADM5_PASS_Q_GENERIC: unspecified quality failure + * + * The module should also set an extended error message with + * krb5_set_error_message(). The message may be localized according to one of + * the language tags in languages. + */ +typedef krb5_error_code +(*krb5_pwqual_check_fn)(krb5_context context, krb5_pwqual_moddata data, + const char *password, const char *policy_name, + krb5_principal princ, const char **languages); + +/* Optional: Release resources used by module data. */ +typedef void +(*krb5_pwqual_close_fn)(krb5_context context, krb5_pwqual_moddata data); + +/*** vtable declarations **/ + +/* Password quality plugin vtable for major version 1. */ +typedef struct krb5_pwqual_vtable_st { + const char *name; /* Mandatory: name of module. */ + krb5_pwqual_open_fn open; + krb5_pwqual_check_fn check; + krb5_pwqual_close_fn close; + /* Minor version 1 ends here. */ +} *krb5_pwqual_vtable; + +#endif /* KRB5_PWQUAL_PLUGIN_H */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/profile.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/profile.h new file mode 100644 index 0000000000000000000000000000000000000000..dcc06bdd9f73d4f4b417bb9441e11592c7ed5add --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/profile.h @@ -0,0 +1,358 @@ +/* + * profile.h + */ + +#ifndef _KRB5_PROFILE_H +#define _KRB5_PROFILE_H + +#if defined(_WIN32) +#include +#endif + +#if defined(__MACH__) && defined(__APPLE__) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +typedef struct _profile_t *profile_t; + +/* Used by profile_init_flags(). */ +#define PROFILE_INIT_ALLOW_MODULE 0x0001 /* Allow module declaration */ + +/* + * Used by the profile iterator in prof_get.c + */ +#define PROFILE_ITER_LIST_SECTION 0x0001 +#define PROFILE_ITER_SECTIONS_ONLY 0x0002 +#define PROFILE_ITER_RELATIONS_ONLY 0x0004 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef char* profile_filespec_t; /* path as C string */ +typedef char* profile_filespec_list_t; /* list of : separated paths, C string */ +typedef const char * const_profile_filespec_t; /* path as C string */ +typedef const char * const_profile_filespec_list_t; /* list of : separated paths, C string */ + +long KRB5_CALLCONV profile_init + (const_profile_filespec_t *files, profile_t *ret_profile); + +long KRB5_CALLCONV profile_init_flags + (const_profile_filespec_t *files, int flags, profile_t *ret_profile); + +long KRB5_CALLCONV profile_init_path + (const_profile_filespec_list_t filelist, profile_t *ret_profile); + +long KRB5_CALLCONV profile_copy + (profile_t, profile_t *); + +long KRB5_CALLCONV profile_flush + (profile_t profile); +long KRB5_CALLCONV profile_flush_to_file + (profile_t profile, const_profile_filespec_t outfile); +long KRB5_CALLCONV profile_flush_to_buffer + (profile_t profile, char **bufp); +void KRB5_CALLCONV profile_free_buffer + (profile_t profile, char *buf); + +long KRB5_CALLCONV profile_is_writable + (profile_t profile, int *writable); +long KRB5_CALLCONV profile_is_modified + (profile_t profile, int *modified); + +void KRB5_CALLCONV profile_abandon + (profile_t profile); + +void KRB5_CALLCONV profile_release + (profile_t profile); + +long KRB5_CALLCONV profile_get_values + (profile_t profile, const char *const *names, char ***ret_values); + +void KRB5_CALLCONV profile_free_list + (char **list); + +long KRB5_CALLCONV profile_get_string + (profile_t profile, const char *name, const char *subname, + const char *subsubname, const char *def_val, + char **ret_string); +long KRB5_CALLCONV profile_get_integer + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long KRB5_CALLCONV profile_get_boolean + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long KRB5_CALLCONV profile_get_relation_names + (profile_t profile, const char **names, char ***ret_names); + +long KRB5_CALLCONV profile_get_subsection_names + (profile_t profile, const char **names, char ***ret_names); + +long KRB5_CALLCONV profile_iterator_create + (profile_t profile, const char *const *names, + int flags, void **ret_iter); + +void KRB5_CALLCONV profile_iterator_free + (void **iter_p); + +long KRB5_CALLCONV profile_iterator + (void **iter_p, char **ret_name, char **ret_value); + +void KRB5_CALLCONV profile_release_string (char *str); + +long KRB5_CALLCONV profile_update_relation + (profile_t profile, const char **names, + const char *old_value, const char *new_value); + +long KRB5_CALLCONV profile_clear_relation + (profile_t profile, const char **names); + +long KRB5_CALLCONV profile_rename_section + (profile_t profile, const char **names, + const char *new_name); + +long KRB5_CALLCONV profile_add_relation + (profile_t profile, const char **names, + const char *new_value); + +/* + * profile_init_vtable allows a caller to create a profile-compatible object + * with a different back end. + */ + +/* + * Mandatory: Look up all of the relations for names, placing the resulting + * values in *ret_values. If no relations exist, return PROF_NO_RELATION, or + * PROF_NO_SECTION to indicate that one of the intermediate names does not + * exist as a section. The list will be freed with free_values. + */ +typedef long +(*profile_get_values_fn)(void *cbdata, const char *const *names, + char ***ret_values); + +/* Mandatory: Free a list of strings returned by get_values. */ +typedef void +(*profile_free_values_fn)(void *cbdata, char **values); + +/* Optional: Release any data associated with the profile. */ +typedef void +(*profile_cleanup_fn)(void *cbdata); + +/* + * Optional (mandatory if cleanup is defined): Generate a new cbdata pointer + * for a copy of the profile. If not implemented, the new profile will receive + * the same cbdata pointer as the old one. + */ +typedef long +(*profile_copy_fn)(void *cbdata, void **ret_cbdata); + +/* + * Optional: Create an iterator handle. + * + * If flags contains PROFILE_ITER_LIST_SECTION, iterate over all of the + * relations and sections within names. Otherwise, iterate over the relation + * values for names, or produce a single section result if names is a section. + * + * If flags contains PROFILE_ITER_SECTIONS_ONLY, produce only sections. + * + * If flags contains PROFILE_ITER_RELATIONS_ONLY, produce only relations. + */ +typedef long +(*profile_iterator_create_fn)(void *cbdata, const char *const *names, + int flags, void **ret_iter); + +/* + * Optional (mandatory if iterator_create is defined): Produce the next + * relation or section in an iteration. If producing a section result, set + * *ret_value to NULL. The returned strings will be freed with free_string. + */ +typedef long +(*profile_iterator_fn)(void *cbdata, void *iter, char **ret_name, + char **ret_value); + +/* + * Optional (mandatory if iterator_create is defined): Free the memory for an + * iterator. + */ +typedef void +(*profile_iterator_free_fn)(void *cbdata, void *iter); + +/* Optional (mandatory if iterator is defined): Free a string value. */ +typedef void +(*profile_free_string_fn)(void *cbdata, char *string); + +/* + * Optional: Determine if a profile is writable. If not implemented, the + * profile is never writable. + */ +typedef long +(*profile_writable_fn)(void *cbdata, int *writable); + +/* + * Optional: Determine if a profile is modified in memory relative to the + * persistent store. If not implemented, the profile is assumed to never be + * modified. + */ +typedef long +(*profile_modified_fn)(void *cbdata, int *modified); + +/* + * Optional: Change the value of a relation, or remove it if new_value is NULL. + * If old_value is set and the relation does not have that value, return + * PROF_NO_RELATION. + */ +typedef long +(*profile_update_relation_fn)(void *cbdata, const char **names, + const char *old_value, const char *new_value); + +/* + * Optional: Rename a section to new_name, or remove the section if new_name is + * NULL. + */ +typedef long +(*profile_rename_section_fn)(void *cbdata, const char **names, + const char *new_name); + +/* + * Optional: Add a new relation, or a new section if new_value is NULL. Add + * any intermediate sections as necessary. + */ +typedef long +(*profile_add_relation_fn)(void *cbdata, const char **names, + const char *new_value); + +/* + * Optional: Flush any pending memory updates to the persistent store. If + * implemented, this function will be called by profile_release as well as + * profile_flush, so make sure it's not inefficient to flush an unmodified + * profile. + */ +typedef long +(*profile_flush_fn)(void *cbdata); + +struct profile_vtable { + int minor_ver; /* Set to structure minor version (currently 1) + * if calling profile_init_vtable. */ + + /* Methods needed for a basic read-only non-iterable profile (cleanup is + * optional). */ + profile_get_values_fn get_values; + profile_free_values_fn free_values; + profile_cleanup_fn cleanup; + profile_copy_fn copy; + + /* Methods for iterable profiles. */ + profile_iterator_create_fn iterator_create; + profile_iterator_fn iterator; + profile_iterator_free_fn iterator_free; + profile_free_string_fn free_string; + + /* Methods for writable profiles. */ + profile_writable_fn writable; + profile_modified_fn modified; + profile_update_relation_fn update_relation; + profile_rename_section_fn rename_section; + profile_add_relation_fn add_relation; + profile_flush_fn flush; + + /* End of minor version 1. */ +}; + +/* + * Create a profile object whose operations will be performed using the + * function pointers in vtable. cbdata will be supplied to each vtable + * function as the first argument. + */ +long KRB5_CALLCONV profile_init_vtable + (struct profile_vtable *vtable, void *cbdata, profile_t *ret_profile); + +/* + * Dynamically loadable profile modules should define a function named + * "profile_module_init" matching the following signature. The function should + * initialize the methods of the provided vtable structure, stopping at the + * field corresponding to vtable->minor_ver. Do not change the value of + * vtable->minor_ver. Unimplemented methods can be left uninitialized. The + * function should supply a callback data pointer in *cb_ret; this pointer can + * be cleaned up via the vtable cleanup method. + */ +typedef long +(*profile_module_init_fn)(const char *residual, struct profile_vtable *vtable, + void **cb_ret); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _KRB5_PROFILE_H */ +/* + * et-h-prof_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define PROF_VERSION (-1429577728L) +#define PROF_MAGIC_NODE (-1429577727L) +#define PROF_NO_SECTION (-1429577726L) +#define PROF_NO_RELATION (-1429577725L) +#define PROF_ADD_NOT_SECTION (-1429577724L) +#define PROF_SECTION_WITH_VALUE (-1429577723L) +#define PROF_BAD_LINK_LIST (-1429577722L) +#define PROF_BAD_GROUP_LVL (-1429577721L) +#define PROF_BAD_PARENT_PTR (-1429577720L) +#define PROF_MAGIC_ITERATOR (-1429577719L) +#define PROF_SET_SECTION_VALUE (-1429577718L) +#define PROF_EINVAL (-1429577717L) +#define PROF_READ_ONLY (-1429577716L) +#define PROF_SECTION_NOTOP (-1429577715L) +#define PROF_SECTION_SYNTAX (-1429577714L) +#define PROF_RELATION_SYNTAX (-1429577713L) +#define PROF_EXTRA_CBRACE (-1429577712L) +#define PROF_MISSING_OBRACE (-1429577711L) +#define PROF_MAGIC_PROFILE (-1429577710L) +#define PROF_MAGIC_SECTION (-1429577709L) +#define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L) +#define PROF_INVALID_SECTION (-1429577707L) +#define PROF_END_OF_SECTIONS (-1429577706L) +#define PROF_BAD_NAMESET (-1429577705L) +#define PROF_NO_PROFILE (-1429577704L) +#define PROF_MAGIC_FILE (-1429577703L) +#define PROF_FAIL_OPEN (-1429577702L) +#define PROF_EXISTS (-1429577701L) +#define PROF_BAD_BOOLEAN (-1429577700L) +#define PROF_BAD_INTEGER (-1429577699L) +#define PROF_MAGIC_FILE_DATA (-1429577698L) +#define PROF_FAIL_INCLUDE_FILE (-1429577697L) +#define PROF_FAIL_INCLUDE_DIR (-1429577696L) +#define PROF_UNSUPPORTED (-1429577695L) +#define PROF_MAGIC_NODE_ITERATOR (-1429577694L) +#define PROF_MODULE (-1429577693L) +#define PROF_MODULE_SYNTAX (-1429577692L) +#define PROF_MODULE_INVALID (-1429577691L) +#define ERROR_TABLE_BASE_prof (-1429577728L) + +extern const struct error_table et_prof_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_prof_error_table (void) /*@modifies internalState@*/; +#else +#define initialize_prof_error_table() +#endif + +#if !defined(_WIN32) +#define init_prof_err_tbl initialize_prof_error_table +#define prof_err_base ERROR_TABLE_BASE_prof +#endif diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto-module.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto-module.h new file mode 100644 index 0000000000000000000000000000000000000000..4ef3b8af60bc4695acd738ddeac08e5edc91397a --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto-module.h @@ -0,0 +1,188 @@ +/* + * Copyright 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/*** THE FOLLOWING ARE FOR IMPLEMENTATION MODULES ONLY ***/ + +#ifndef VERTO_MODULE_H_ +#define VERTO_MODULE_H_ + +#include + +#ifndef VERTO_MODULE_TYPES +#define VERTO_MODULE_TYPES +typedef void verto_mod_ctx; +typedef void verto_mod_ev; +#endif + +#define VERTO_MODULE_VERSION 3 +#define VERTO_MODULE_TABLE(name) verto_module_table_ ## name +#define VERTO_MODULE(name, symb, types) \ + static verto_ctx_funcs name ## _funcs = { \ + name ## _ctx_new, \ + name ## _ctx_default, \ + name ## _ctx_free, \ + name ## _ctx_run, \ + name ## _ctx_run_once, \ + name ## _ctx_break, \ + name ## _ctx_reinitialize, \ + name ## _ctx_set_flags, \ + name ## _ctx_add, \ + name ## _ctx_del \ + }; \ + verto_module VERTO_MODULE_TABLE(name) = { \ + VERTO_MODULE_VERSION, \ + # name, \ + # symb, \ + types, \ + &name ## _funcs, \ + }; \ + verto_ctx * \ + verto_new_ ## name() \ + { \ + return verto_convert(name, 0, NULL); \ + } \ + verto_ctx * \ + verto_default_ ## name() \ + { \ + return verto_convert(name, 1, NULL); \ + } + +typedef struct { + /* Required */ verto_mod_ctx *(*ctx_new)(); + /* Optional */ verto_mod_ctx *(*ctx_default)(); + /* Required */ void (*ctx_free)(verto_mod_ctx *ctx); + /* Optional */ void (*ctx_run)(verto_mod_ctx *ctx); + /* Required */ void (*ctx_run_once)(verto_mod_ctx *ctx); + /* Optional */ void (*ctx_break)(verto_mod_ctx *ctx); + /* Optional */ void (*ctx_reinitialize)(verto_mod_ctx *ctx); + /* Optional */ void (*ctx_set_flags)(verto_mod_ctx *ctx, + const verto_ev *ev, + verto_mod_ev *modev); + /* Required */ verto_mod_ev *(*ctx_add)(verto_mod_ctx *ctx, + const verto_ev *ev, + verto_ev_flag *flags); + /* Required */ void (*ctx_del)(verto_mod_ctx *ctx, + const verto_ev *ev, + verto_mod_ev *modev); +} verto_ctx_funcs; + +typedef struct { + unsigned int vers; + const char *name; + const char *symb; + verto_ev_type types; + verto_ctx_funcs *funcs; +} verto_module; + +/** + * Converts an existing implementation specific loop to a verto_ctx. + * + * This function also sets the internal default implementation so that future + * calls to verto_new(NULL) or verto_default(NULL) will use this specific + * implementation if it was not already set. + * + * @param name The name of the module (unquoted) + * @param deflt Whether the ctx is the default context or not + * @param ctx The context to store + * @return A new verto_ctx, or NULL on error. Call verto_free() when done. + */ +#define verto_convert(name, deflt, ctx) \ + verto_convert_module(&VERTO_MODULE_TABLE(name), deflt, ctx) + +/** + * Converts an existing implementation specific loop to a verto_ctx. + * + * If you are a module implementation, you probably want the macro above. This + * function is generally used directly only when an application is attempting + * to expose a home-grown event loop to verto. + * + * If deflt is non-zero and a default ctx was already defined for this module + * and ctx is not NULL, than ctx will be free'd and the previously defined + * default will be returned. + * + * If ctx is non-NULL, than the pre-existing verto_mod_ctx will be converted to + * to a verto_ctx; if deflt is non-zero than this verto_mod_ctx will also be + * marked as the default loop for this process. If ctx is NULL, than the + * appropriate constructor will be called: either module->ctx_new() or + * module->ctx_default() depending on the boolean value of deflt. If + * module->ctx_default is NULL and deflt is non-zero, than module->ctx_new() + * will be called and the resulting verto_mod_ctx will be utilized as the + * default. + * + * This function also sets the internal default implementation so that future + * calls to verto_new(NULL) or verto_default(NULL) will use this specific + * implementation if it was not already set. + * + * @param name The name of the module (unquoted) + * @param ctx The context private to store + * @return A new verto_ctx, or NULL on error. Call verto_free() when done. + */ +verto_ctx * +verto_convert_module(const verto_module *module, int deflt, verto_mod_ctx *ctx); + +/** + * Calls the callback of the verto_ev and then frees it via verto_del(). + * + * The verto_ev is not freed (verto_del() is not called) if it is a signal event. + * + * @see verto_add_read() + * @see verto_add_write() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @see verto_del() + * @param ev The verto_ev + */ +void +verto_fire(verto_ev *ev); + +/** + * Sets the status of the pid/handle which caused this event to fire. + * + * This function does nothing if the verto_ev is not a child type. + * + * @see verto_add_child() + * @param ev The verto_ev to set the status in. + * @param status The pid/handle status. + */ +void +verto_set_proc_status(verto_ev *ev, verto_proc_status status); + +/** + * Sets the state of the fd which caused this event to fire. + * + * This function does nothing if the verto_ev is not a io type. + * + * Only the flags VERTO_EV_FLAG_IO_(READ|WRITE|ERROR) are supported. All other + * flags are unset. + * + * @see verto_add_io() + * @param ev The verto_ev to set the state in. + * @param state The fd state. + */ +void +verto_set_fd_state(verto_ev *ev, verto_ev_flag state); + +#endif /* VERTO_MODULE_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto.h b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto.h new file mode 100644 index 0000000000000000000000000000000000000000..55c583616215f76c49ead255c33a1572c1947deb --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/include/verto.h @@ -0,0 +1,575 @@ +/* + * Copyright 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef VERTO_H_ +#define VERTO_H_ + +#include /* For time_t */ +#include /* For pid_t */ + +#ifdef WIN32 +#include +typedef HANDLE verto_proc; +typedef DWORD verto_proc_status; +#else +#include +typedef pid_t verto_proc; +typedef int verto_proc_status; +#endif + +#define VERTO_SIG_IGN ((verto_callback *) 1) + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +typedef struct verto_ctx verto_ctx; +typedef struct verto_ev verto_ev; + +typedef enum { + VERTO_EV_TYPE_NONE = 0, + VERTO_EV_TYPE_IO = 1, + VERTO_EV_TYPE_TIMEOUT = 1 << 1, + VERTO_EV_TYPE_IDLE = 1 << 2, + VERTO_EV_TYPE_SIGNAL = 1 << 3, + VERTO_EV_TYPE_CHILD = 1 << 4 +} verto_ev_type; + +typedef enum { + VERTO_EV_FLAG_NONE = 0, + VERTO_EV_FLAG_PERSIST = 1, + VERTO_EV_FLAG_PRIORITY_LOW = 1 << 1, + VERTO_EV_FLAG_PRIORITY_MEDIUM = 1 << 2, + VERTO_EV_FLAG_PRIORITY_HIGH = 1 << 3, + VERTO_EV_FLAG_IO_READ = 1 << 4, + VERTO_EV_FLAG_IO_WRITE = 1 << 5, + VERTO_EV_FLAG_IO_ERROR = 1 << 7, + VERTO_EV_FLAG_IO_CLOSE_FD = 1 << 8, + VERTO_EV_FLAG_REINITIABLE = 1 << 6, + _VERTO_EV_FLAG_MUTABLE_MASK = VERTO_EV_FLAG_PRIORITY_LOW + | VERTO_EV_FLAG_PRIORITY_MEDIUM + | VERTO_EV_FLAG_PRIORITY_HIGH + | VERTO_EV_FLAG_IO_READ + | VERTO_EV_FLAG_IO_WRITE, + _VERTO_EV_FLAG_MAX = VERTO_EV_FLAG_IO_CLOSE_FD +} verto_ev_flag; + +typedef void (verto_callback)(verto_ctx *ctx, verto_ev *ev); + +/** + * Creates a new event context using an optionally specified implementation + * and/or optionally specified required features. + * + * If you are an application that has already decided on using a particular + * event loop implementation, you should not call this function, but instead + * import the verto-NAME.h header and link against the verto-NAME.so, where + * NAME is the implementation you wish to use. + * + * If you are a library, you should generally avoid creating event contexts + * on your own but allow applications to pass in a verto_ctx you can use. + * + * There are two cases where you should use this function. The first is + * where you have a need to choose an implementation at run time, usually + * for testing purposes. The second and more common is when you simply + * wish to remain implementation agnostic. In this later case, you should + * always call like this: verto_new(NULL, ...). This lets verto choose the best + * implementation to use. + * + * If impl is not NULL, a new context is returned which is backed by the + * implementation specified. If the implementation specified is not + * available or if the required types (reqtypes) are not provided by the + * named implementation, NULL is returned. The parameter 'impl' can specify: + * * The full path to an implementation library + * * The name of the implementation library (i.e. - "glib" or "libev") + * + * If impl is NULL, verto will attempt to automatically determine the + * best implementation to use. + * + * First, verto will attempt to use an existing, previously loaded + * implementation. This is handled automatically by internal caching of either + * the first implementation loaded or the one specified by verto_set_default(). + * + * Second, verto will attempt to discern if you are already linked to any + * of the supported implementations (to avoid wasting memory by loading + * extra unnecessary libraries). If you are linked to one supported + * implementation, that implementation will be chosen. If you are linked + * to more than one supported implementation one of the ones linked to + * will be chosen, but the order of the particular choice is undefined. + * + * Third, verto will attempt to load the compile-time default, if defined at + * build time and available at runtime. + * + * Last, verto will attempt to load any implementation installed. The specific + * order of this step is undefined. + * + * In all cases above, if the implementation does not support all the specified + * features (reqtypes), it will be skipped and processing will continue from + * where it left off. This means that if verto_new() returns non-NULL it is + * guaranteed to support the features you specified. + * + * @see verto_set_default() + * @param impl The implementation to use, or NULL. + * @param reqtypes A bitwise or'd list of required event type features. + * @return A new verto_ctx, or NULL on error. Call verto_free() when done. + */ +verto_ctx * +verto_new(const char *impl, verto_ev_type reqtypes); + +/** + * Gets the default event context using an optionally specified implementation. + * + * This function is essentially a singleton version of verto_new(). However, + * since this function must return the same loop as the *_default() call of + * the underlying implementation (if such a function exists), it is NOT a + * global singleton, but a per-implementation singleton. For this reason, you + * must call verto_free() when you are done with this loop. Even after calling + * verto_free() on the default verto_ctx, you can safely call verto_default() + * again and receive a new reference to the same (internally default) loop. + * + * In all other respects, verto_default() acts exactly like verto_new(). + * + * @see verto_new() + * @see verto_free() + * @param impl The implementation to use, or NULL. + * @param reqtypes A bitwise or'd list of required event type features. + * @return The default verto_ctx, or NULL on error. Call verto_free() when done. + */ +verto_ctx * +verto_default(const char *impl, verto_ev_type reqtypes); + +/** + * Sets the default implementation to use by its name. + * + * This function returns 1 on success and 0 on failure. It can fail for the + * following reasons: + * 1. The default implementation was already set via verto_set_default(). + * 2. The implementation specified could not be found. + * 3. The implementation specified didn't support the features specified. + * 4. The impl argument was NULL. + * 5. verto_new() was already called. + * 6. verto_default() was already called. + * 7. verto_new_NAME() was already called. + * 8. verto_default_NAME() was already called. + * 9. verto_convert_NAME() was already called. + * + * @see verto_new() + * @see verto_default() + * @param impl The implementation to use. + * @param reqtypes A bitwise or'd list of required event type features. + * @return The default verto_ctx, or NULL on error. Call verto_free() when done. + */ +int +verto_set_default(const char *impl, verto_ev_type reqtypes); + +/** + * Sets the allocator to use for verto_ctx and verto_ev objects. + * + * If you plan to set the allocator, you MUST call this function before any + * other verto_*() calls. + * + * @see verto_new() + * @see verto_default() + * @see verto_add_io() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @param resize The allocator to use (behaves like realloc(); + * resize(ptr, 0) must free memory at ptr.) + * @param hierarchical Zero if the allocator is not hierarchical + */ +int +verto_set_allocator(void *(*resize)(void *mem, size_t size), int hierarchical); + +/** + * Frees a verto_ctx. + * + * When called on a default verto_ctx, the reference will be freed but the + * internal default loop will still be available via another call to + * verto_default(). + * + * @see verto_new() + * @see verto_default() + * @param ctx The verto_ctx to free. + */ +void +verto_free(verto_ctx *ctx); + +/** + * Frees global state. + * + * Remove and free all allocated global state. Call only when no further + * contexts exist and all threads have exited. + * + * @see verto_new() + * @see verto_free() + * @see verto_default() + */ +void +verto_cleanup(void); + +/** + * Run the verto_ctx forever, or at least until verto_break() is called. + * + * @see verto_break() + * @param ctx The verto_ctx to run. + */ +void +verto_run(verto_ctx *ctx); + +/** + * Run the verto_ctx once. May block. + * + * @param ctx The verto_ctx to run once. + */ +void +verto_run_once(verto_ctx *ctx); + +/** + * Exits the currently running verto_ctx. + * + * @see verto_run() + * @param ctx The verto_ctx to exit. + */ +void +verto_break(verto_ctx *ctx); + +/** + * Re-initializes the verto_ctx. + * + * This function deletes all events, except those which have set the + * VERTO_EV_FLAG_REINITIABLE flag. If you fork(), you MUST call this in the + * child process after the fork! + * + * If this function fails it indicates that at least one + * VERTO_EV_FLAG_REINITIABLE event was not rearmed or that ctx was NULL. + * + * @see verto_new() + * @see verto_default() + * @param ctx The verto_ctx to re-initialize. + * @return Non-zero on success, 0 on error. + */ +int +verto_reinitialize(verto_ctx *ctx); + +/** + * Adds a callback executed when a file descriptor is ready to be read/written. + * + * All verto_ev events are automatically freed when their parent verto_ctx is + * freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is + * provided, the event will repeat until verto_del() is called. If + * VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically + * after its execution. In either case, you may call verto_del() at any time + * to prevent the event from executing. + * If VERTO_EV_FLAG_IO_CLOSE_FD is provided the passed in fd is automatically + * closed when the event is freed with verto_del() + * + * NOTE: On Windows, the underlying select() only works with sockets. As such, + * any attempt to add a non-socket io event on Windows will produce undefined + * results and may even crash. + * + * @see verto_del() + * @param ctx The verto_ctx which will fire the callback. + * @param flags The flags to set (at least one VERTO_EV_FLAG_IO* required). + * @param callback The callback to fire. + * @param fd The file descriptor to watch for reads. + * @return The verto_ev registered with the event context or NULL on error. + */ +verto_ev * +verto_add_io(verto_ctx *ctx, verto_ev_flag flags, + verto_callback *callback, int fd); + +/** + * Adds a callback executed after a period of time. + * + * All verto_ev events are automatically freed when their parent verto_ctx is + * freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is + * provided, the event will repeat until verto_del() is called. If + * VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically + * after its execution. In either case, you may call verto_del() at any time + * to prevent the event from executing. + * + * @see verto_del() + * @param ctx The verto_ctx which will fire the callback. + * @param flags The flags to set. + * @param callback The callback to fire. + * @param interval Time period to wait before firing (in milliseconds). + * @return The verto_ev registered with the event context. + */ +verto_ev * +verto_add_timeout(verto_ctx *ctx, verto_ev_flag flags, + verto_callback *callback, time_t interval); + +/** + * Adds a callback executed when there is nothing else to do. + * + * All verto_ev events are automatically freed when their parent verto_ctx is + * freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is + * provided, the event will repeat until verto_del() is called. If + * VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically + * after its execution. In either case, you may call verto_del() at any time + * to prevent the event from executing. + * + * @see verto_del() + * @param ctx The verto_ctx which will fire the callback. + * @param flags The flags to set. + * @param callback The callback to fire. + * @return The verto_ev registered with the event context. + */ +verto_ev * +verto_add_idle(verto_ctx *ctx, verto_ev_flag flags, + verto_callback *callback); + +/** + * Adds a callback executed when a signal is received. + * + * All verto_ev events are automatically freed when their parent verto_ctx is + * freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is + * provided, the event will repeat until verto_del() is called. If + * VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically + * after its execution. In either case, you may call verto_del() at any time + * to prevent the event from executing. + * + * NOTE: If you attempt to ignore a signal without the VERTO_EV_FLAG_PERSIST + * flag, this function fails. + * + * NOTE: SIGCHLD is expressly not supported. If you want this notification, + * please use verto_add_child(). + * + * WARNNIG: Signal events can only be reliably received in the default verto_ctx + * in some implementations. Attempting to receive signal events in non-default + * loops may result in assert() failures. + * + * WARNING: While verto does its best to protect you from crashes, there is + * essentially no way to do signal events if you mix multiple implementations in + * a single process. Attempting to do so will result in undefined behavior, + * and potentially even a crash. You have been warned. + * + * @see verto_add_child() + * @see verto_repeat() + * @see verto_del() + * @param ctx The verto_ctx which will fire the callback. + * @param flags The flags to set. + * @param callback The callback to fire. + * @param signal The signal to watch for. + * @return The verto_ev registered with the event context. + */ +verto_ev * +verto_add_signal(verto_ctx *ctx, verto_ev_flag flags, + verto_callback *callback, int signal); + +/** + * Adds a callback executed when a child process exits. + * + * This event will be freed automatically after its execution. Due to the + * nature of a process' life-cycle, child events cannot persist (processes only + * exit once). This function returns NULL if you attempt to use + * VERTO_EV_FLAG_PERSIST. You may, of course, call verto_del() at any time to + * prevent the callback from firing. + * + * @see verto_del() + * @param ctx The verto_ctx which will fire the callback. + * @param flags The flags to set. + * @param callback The callback to fire. + * @param child The pid (POSIX) or handle (Win32) of the child to watch for. + * @return The verto_ev registered with the event context. + */ +verto_ev * +verto_add_child(verto_ctx *ctx, verto_ev_flag flags, + verto_callback *callback, verto_proc proc); + +/** + * Sets the private pointer of the verto_ev. + * + * The free callback will be called in two cases: + * 1. When the event is deleted (manually or automatically) + * 2. When verto_set_private() is called again, unless + * free is NULL. + * + * @see verto_get_private() + * @param ev The verto_ev + * @param priv The private value to store + * @param free The callback used to free the data or NULL + */ +void +verto_set_private(verto_ev *ev, void *priv, verto_callback *free); + +/** + * Gets the private pointer of the verto_ev. + * + * @see verto_set_private() + * @param ev The verto_ev + * @return The verto_ev private pointer + */ +void * +verto_get_private(const verto_ev *ev); + +/** + * Gets the type of the verto_ev. + * + * @see verto_add_io() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @param ev The verto_ev + * @return The verto_ev type + */ +verto_ev_type +verto_get_type(const verto_ev *ev); + +/** + * Gets the flags associated with the given verto_ev. + * + * @see verto_add_io() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @see verto_set_flags() + * @param ev The verto_ev + * @return The verto_ev type + */ +verto_ev_flag +verto_get_flags(const verto_ev *ev); + +/** + * Sets the flags associated with the given verto_ev. + * + * See _VERTO_EV_FLAG_MUTABLE_MASK for the flags that can be changed + * with this function. All others will be ignored. If the flags specified + * are the same as the flags the event already has, this function is a no-op. + * + * @see verto_add_io() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @see verto_get_flags() + * @param ev The verto_ev + * @param flags The flags for the event + */ +void +verto_set_flags(verto_ev *ev, verto_ev_flag flags); + +/** + * Gets the file descriptor associated with a read/write verto_ev. + * + * @see verto_add_io() + * @param ev The verto_ev to retrieve the file descriptor from. + * @return The file descriptor, or -1 if not a read/write event. + */ +int +verto_get_fd(const verto_ev *ev); + +/** + * Gets the file descriptor state from when the event fires. + * + * @see verto_add_io() + * @param ev The verto_ev to retrieve the fd state from. + * @return The fd state. + */ +verto_ev_flag +verto_get_fd_state(const verto_ev *ev); + +/** + * Gets the interval associated with a timeout verto_ev. + * + * @see verto_add_timeout() + * @param ev The verto_ev to retrieve the interval from. + * @return The interval, or 0 if not a timeout event. + */ +time_t +verto_get_interval(const verto_ev *ev); + +/** + * Gets the signal associated with a signal verto_ev. + * + * @see verto_add_signal() + * @param ev The verto_ev to retrieve the signal from. + * @return The signal, or -1 if not a signal event. + */ +int +verto_get_signal(const verto_ev *ev); + +/** + * Gets the process associated with a child verto_ev. + * + * @see verto_add_child() + * @param ev The verto_ev to retrieve the process from. + * @return The pid/handle, or 0/NULL if not a child event (POSIX/Win32). + */ +verto_proc +verto_get_proc(const verto_ev *ev); + +/** + * Gets the status of the process which caused this event to fire. + * + * @see verto_add_child() + * @param ev The verto_ev to retrieve the status from. + * @return The pid/handle status. + */ +verto_proc_status +verto_get_proc_status(const verto_ev *ev); + +/** + * Gets the verto_ctx associated with a verto_ev. + * + * This is a borrowed reference, don't attempt to free it! + * + * @param ev The verto_ev to retrieve the verto_ctx from. + * @return The verto_ctx. + */ +verto_ctx * +verto_get_ctx(const verto_ev *ev); + +/** + * Removes an event from from the event context and frees it. + * + * The event and its contents cannot be used after this call. + * + * @see verto_add_io() + * @see verto_add_timeout() + * @see verto_add_idle() + * @see verto_add_signal() + * @see verto_add_child() + * @param ev The event to delete. + */ +void +verto_del(verto_ev *ev); + +/** + * Returns the event types supported by this implementation. + * + * @param ctx The verto_ctx to query. + * @return The event types supported. + */ +verto_ev_type +verto_get_supported_types(verto_ctx *ctx); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ +#endif /* VERTO_H_ */ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/about.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..39ecf90a7b2c96b2da8e16ef1f3ff6021d63f5fb --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/about.json @@ -0,0 +1,181 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "description": "Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using secret-key cryptography.\n", + "dev_url": "https://github.com/krb5/krb5", + "doc_url": "https://web.mit.edu/kerberos/krb5-1.21/doc/index.html", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "parent_recipe": { + "name": "krb5-split", + "path": "/home/task_176848925151491/krb5-feedstock/recipe", + "version": "1.22.1" + }, + "recipe-maintainers": [ + "pelson", + "ocefpaf", + "mingwandroid", + "mariusvniekerk", + "chenghlee" + ] + }, + "home": "https://web.mit.edu/kerberos", + "identifiers": [], + "keywords": [], + "license": "MIT", + "license_family": "MIT", + "license_file": "doc/notice.rst", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.11.4 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.7.3 h3385a95_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "patch 2.8 hb25bd0a_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libiconv 1.16 h5eee18b_3", + "liblief 0.12.3 h6a678d5_0", + "libsodium 1.0.20 heac8642_0", + "libunistring 1.3 hb25bd0a_0", + "openssl 3.0.18 hd6dcaed_0", + "patchelf 0.17.2 h6a678d5_0", + "perl 5.40.2 0_h5eee18b_perl5", + "pthread-stubs 0.3 h0ce48e5_1", + "xorg-libxau 1.0.12 h9b100fa_0", + "xorg-libxdmcp 1.1.5 h9b100fa_0", + "xorg-xorgproto 2024.1 h5eee18b_1", + "yaml 0.2.5 h7b6447c_0", + "libxcb 1.17.0 h9b100fa_0", + "gettext 0.21.0 hedfda30_2", + "xorg-libx11 1.8.12 h9b100fa_1", + "libidn2 2.3.8 hf80d704_0", + "tk 8.6.15 h54e0aa7_0", + "libcurl 8.16.0 heebcbe5_0", + "git 2.51.0 pl5382h000ed5b_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 25.4.0 py312h06a4308_2", + "certifi 2025.10.5 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.20.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.8.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_1", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.28.0 py312h498d7c9_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.37.0 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.40.54 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_1", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_1", + "s3transfer 0.14.0 py312h06a4308_0", + "boto3 1.40.54 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "A network authentication protocol.", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/files b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..1905fda4dc85a22e14ff7964b4106f5a486fdfc1 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/files @@ -0,0 +1,84 @@ +bin/compile_et +bin/krb5-config +include/com_err.h +include/gssapi.h +include/gssapi/gssapi.h +include/gssapi/gssapi_alloc.h +include/gssapi/gssapi_ext.h +include/gssapi/gssapi_generic.h +include/gssapi/gssapi_krb5.h +include/gssapi/mechglue.h +include/gssrpc/auth.h +include/gssrpc/auth_gss.h +include/gssrpc/auth_gssapi.h +include/gssrpc/auth_unix.h +include/gssrpc/clnt.h +include/gssrpc/netdb.h +include/gssrpc/pmap_clnt.h +include/gssrpc/pmap_prot.h +include/gssrpc/pmap_rmt.h +include/gssrpc/rename.h +include/gssrpc/rpc.h +include/gssrpc/rpc_msg.h +include/gssrpc/svc.h +include/gssrpc/svc_auth.h +include/gssrpc/types.h +include/gssrpc/xdr.h +include/kadm5/admin.h +include/kadm5/chpass_util_strings.h +include/kadm5/kadm_err.h +include/kdb.h +include/krad.h +include/krb5.h +include/krb5/ccselect_plugin.h +include/krb5/certauth_plugin.h +include/krb5/clpreauth_plugin.h +include/krb5/hostrealm_plugin.h +include/krb5/kadm5_auth_plugin.h +include/krb5/kadm5_hook_plugin.h +include/krb5/kdcpolicy_plugin.h +include/krb5/kdcpreauth_plugin.h +include/krb5/krb5.h +include/krb5/localauth_plugin.h +include/krb5/locate_plugin.h +include/krb5/plugin.h +include/krb5/preauth_plugin.h +include/krb5/pwqual_plugin.h +include/profile.h +include/verto-module.h +include/verto.h +lib/libcom_err.so +lib/libcom_err.so.3 +lib/libcom_err.so.3.0 +lib/libgssapi_krb5.so +lib/libgssapi_krb5.so.2 +lib/libgssapi_krb5.so.2.2 +lib/libgssrpc.so +lib/libgssrpc.so.4 +lib/libgssrpc.so.4.2 +lib/libk5crypto.so +lib/libk5crypto.so.3 +lib/libk5crypto.so.3.1 +lib/libkadm5clnt.so +lib/libkadm5clnt_mit.so +lib/libkadm5clnt_mit.so.12 +lib/libkadm5clnt_mit.so.12.0 +lib/libkadm5srv.so +lib/libkadm5srv_mit.so +lib/libkadm5srv_mit.so.12 +lib/libkadm5srv_mit.so.12.0 +lib/libkdb5.so +lib/libkdb5.so.10 +lib/libkdb5.so.10.0 +lib/libkrad.so +lib/libkrad.so.0 +lib/libkrad.so.0.0 +lib/libkrb5.so +lib/libkrb5.so.3 +lib/libkrb5.so.3.3 +lib/libkrb5support.so +lib/libkrb5support.so.0 +lib/libkrb5support.so.0.1 +lib/libverto.so +lib/libverto.so.0 +lib/libverto.so.0.0 diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/git b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/has_prefix b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..ada67391c1b37b29475a799fe200ed32862985d8 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/has_prefix @@ -0,0 +1,7 @@ +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ binary lib/libgssapi_krb5.so.2.2 +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ binary lib/libkadm5clnt_mit.so.12.0 +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ binary lib/libkadm5srv_mit.so.12.0 +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ binary lib/libkdb5.so.10.0 +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ binary lib/libkrb5.so.3.3 +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ text bin/compile_et +/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ text bin/krb5-config diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/hash_input.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..720cbc76669f1d9fa0afbc6681b54d0e19ee620e --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/hash_input.json @@ -0,0 +1,18 @@ +{ + "c_stdlib_version": "2.28", + "libedit": "3.1", + "BUILD": "x86_64-conda_el8-linux-gnu", + "target_platform": "linux-64", + "ncurses": "6", + "cxx_compiler": "gxx", + "gettext": "0", + "channel_targets": "defaults", + "openssl": "3", + "c_compiler_version": "14.3.0", + "lmdb": "0", + "cxx_compiler_version": "14.3.0", + "libkrb5": "1.21", + "c_stdlib": "sysroot", + "c_compiler": "gcc", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/index.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..2caa060c773ef9dafc3c0dd317ad10fbcff9c7c9 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/index.json @@ -0,0 +1,19 @@ +{ + "arch": "x86_64", + "build": "h6d2bf13_0", + "build_number": 0, + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libstdcxx >=14", + "lmdb", + "openssl >=3.0.18,<4.0a0" + ], + "license": "MIT", + "license_family": "MIT", + "name": "libkrb5", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1768489517706, + "version": "1.22.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/licenses/doc/notice.rst b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/licenses/doc/notice.rst new file mode 100644 index 0000000000000000000000000000000000000000..e27615626046c2a45b3d008ff6c57cd548c33638 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/licenses/doc/notice.rst @@ -0,0 +1,1302 @@ +Copyright |copy| 1985-2025 by the Massachusetts Institute of Technology. + +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. + +Downloading of this software may constitute an export of cryptographic +software from the United States of America that is subject to the +United States Export Administration Regulations (EAR), 15 CFR 730-774. +Additional laws or regulations may apply. It is the responsibility of +the person or entity contemplating export to comply with all +applicable export laws and regulations, including obtaining any +required license from the U.S. government. + +The U.S. government prohibits export of encryption source code to +certain countries and individuals, including, but not limited to, the +countries of Cuba, Iran, North Korea, Sudan, Syria, and residents and +nationals of those countries. + +Documentation components of this software distribution are licensed +under a Creative Commons Attribution-ShareAlike 3.0 Unported License. +(https://creativecommons.org/licenses/by-sa/3.0/) + +Individual source code files are copyright MIT, Cygnus Support, +Novell, OpenVision Technologies, Oracle, Red Hat, Sun Microsystems, +FundsXpress, and others. + +Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira, +and Zephyr are trademarks of the Massachusetts Institute of Technology +(MIT). No commercial use of these trademarks may be made without +prior written permission of MIT. + +"Commercial use" means use of a name in a product or other for-profit +manner. It does NOT prevent a commercial firm from referring to the +MIT trademarks in order to convey information (although in doing so, +recognition of their trademark status should be given). + +------------------- + +The following copyright and permission notice applies to the +OpenVision Kerberos Administration system located in +``kadmin/create``, ``kadmin/dbutil``, ``kadmin/passwd``, +``kadmin/server``, ``lib/kadm5``, and portions of +``lib/rpc``: + + Copyright, OpenVision Technologies, Inc., 1993-1996, All Rights Reserved + + WARNING: Retrieving the OpenVision Kerberos Administration system source + code, as described below, indicates your acceptance of the following + terms. If you do not agree to the following terms, do not retrieve the + OpenVision Kerberos administration system. + + You may freely use and distribute the Source Code and Object Code + compiled from it, with or without modification, but this Source Code is + provided to you "AS IS" EXCLUSIVE OF ANY WARRANTY, INCLUDING, WITHOUT + LIMITATION, ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE, OR ANY OTHER WARRANTY, WHETHER EXPRESS OR IMPLIED. + IN NO EVENT WILL OPENVISION HAVE ANY LIABILITY FOR ANY LOST PROFITS, + LOSS OF DATA OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR + FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS + AGREEMENT, INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM THE USE + OF THE SOURCE CODE, OR THE FAILURE OF THE SOURCE CODE TO PERFORM, OR FOR + ANY OTHER REASON. + + OpenVision retains all copyrights in the donated Source Code. OpenVision + also retains copyright to derivative works of the Source Code, whether + created by OpenVision or by a third party. The OpenVision copyright + notice must be preserved if derivative works are made based on the + donated Source Code. + + OpenVision Technologies, Inc. has donated this Kerberos Administration + system to MIT for inclusion in the standard Kerberos 5 distribution. + This donation underscores our commitment to continuing Kerberos + technology development and our gratitude for the valuable work which has + been performed by MIT and the Kerberos community. + +------------------- + + Portions contributed by Matt Crawford ``crawdad@fnal.gov`` were work + performed at Fermi National Accelerator Laboratory, which is operated + by Universities Research Association, Inc., under contract + DE-AC02-76CHO3000 with the U.S. Department of Energy. + +------------------- + +Portions of ``src/lib/crypto`` have the following copyright: + + Copyright |copy| 1998 by the FundsXpress, INC. + + All rights reserved. + + Export of this software from the United States of America may require + a specific license from the United States Government. It is the + responsibility of any person or organization contemplating export to + obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of FundsXpress. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. FundsXpress makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + + THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +------------------- + +The implementation of the AES encryption algorithm in +``src/lib/crypto/builtin/aes`` has the following copyright: + + | Copyright |copy| 1998-2013, Brian Gladman, Worcester, UK. All + | rights reserved. + + The redistribution and use of this software (with or without + changes) is allowed without the payment of fees or royalties + provided that: + + source code distributions include the above copyright notice, + this list of conditions and the following disclaimer; + + binary distributions include the above copyright notice, this + list of conditions and the following disclaimer in their + documentation. + + This software is provided 'as is' with no explicit or implied warranties + in respect of its operation, including, but not limited to, correctness + and fitness for purpose. + +------------------- + +Portions contributed by Red Hat, including the pre-authentication +plug-in framework and the NSS crypto implementation, contain the +following copyright: + + | Copyright |copy| 2006 Red Hat, Inc. + | Portions copyright |copy| 2006 Massachusetts Institute of Technology + | 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 of Red Hat, Inc., 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 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. + +------------------- + +The bundled verto source code is subject to the following license: + + Copyright 2011 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +------------------- + +The MS-KKDCP client implementation has the following copyright: + + Copyright 2013,2014 Red Hat, Inc. + + 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. + + 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. + +------------------- + +The implementations of GSSAPI mechglue in GSSAPI-SPNEGO in +``src/lib/gssapi``, including the following files: + +.. parsed-literal:: + + lib/gssapi/generic/gssapi_err_generic.et + lib/gssapi/mechglue/g_accept_sec_context.c + lib/gssapi/mechglue/g_acquire_cred.c + lib/gssapi/mechglue/g_canon_name.c + lib/gssapi/mechglue/g_compare_name.c + lib/gssapi/mechglue/g_context_time.c + lib/gssapi/mechglue/g_delete_sec_context.c + lib/gssapi/mechglue/g_dsp_name.c + lib/gssapi/mechglue/g_dsp_status.c + lib/gssapi/mechglue/g_dup_name.c + lib/gssapi/mechglue/g_exp_sec_context.c + lib/gssapi/mechglue/g_export_name.c + lib/gssapi/mechglue/g_glue.c + lib/gssapi/mechglue/g_imp_name.c + lib/gssapi/mechglue/g_imp_sec_context.c + lib/gssapi/mechglue/g_init_sec_context.c + lib/gssapi/mechglue/g_initialize.c + lib/gssapi/mechglue/g_inquire_context.c + lib/gssapi/mechglue/g_inquire_cred.c + lib/gssapi/mechglue/g_inquire_names.c + lib/gssapi/mechglue/g_process_context.c + lib/gssapi/mechglue/g_rel_buffer.c + lib/gssapi/mechglue/g_rel_cred.c + lib/gssapi/mechglue/g_rel_name.c + lib/gssapi/mechglue/g_rel_oid_set.c + lib/gssapi/mechglue/g_seal.c + lib/gssapi/mechglue/g_sign.c + lib/gssapi/mechglue/g_store_cred.c + lib/gssapi/mechglue/g_unseal.c + lib/gssapi/mechglue/g_userok.c + lib/gssapi/mechglue/g_utils.c + lib/gssapi/mechglue/g_verify.c + lib/gssapi/mechglue/gssd_pname_to_uid.c + lib/gssapi/mechglue/mglueP.h + lib/gssapi/mechglue/oid_ops.c + lib/gssapi/spnego/gssapiP_spnego.h + lib/gssapi/spnego/spnego_mech.c + +and the initial implementation of incremental propagation, including +the following new or changed files: + +.. parsed-literal:: + + include/iprop_hdr.h + kadmin/server/ipropd_svc.c + lib/kdb/iprop.x + lib/kdb/kdb_convert.c + lib/kdb/kdb_log.c + lib/kdb/kdb_log.h + lib/krb5/error_tables/kdb5_err.et + kprop/kpropd_rpc.c + kprop/kproplog.c + +are subject to the following license: + + Copyright |copy| 2004 Sun Microsystems, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------- + +Kerberos V5 includes documentation and software developed at the +University of California at Berkeley, which includes this copyright +notice: + + | Copyright |copy| 1983 Regents of the University of California. + | 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. + +------------------- + +Portions contributed by Novell, Inc., including the LDAP database +backend, are subject to the following license: + + | Copyright |copy| 2004-2005, Novell, 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. + * The copyright holder's name is not 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. + +------------------- + +Portions funded by Sandia National Laboratory +and developed by the University of Michigan's +Center for Information Technology Integration, +including the PKINIT implementation, are subject +to the following license: + + | COPYRIGHT |copy| 2006-2007 + | THE REGENTS OF THE UNIVERSITY OF MICHIGAN + | ALL RIGHTS RESERVED + + Permission is granted to use, copy, create derivative works + and redistribute this software and such derivative works + for any purpose, so long as the name of The University of + Michigan is not used in any advertising or publicity + pertaining to the use of distribution of this software + without specific, written prior authorization. If the + above copyright notice or any other identification of the + University of Michigan is included in any copy of any + portion of this software, then the disclaimer below must + also be included. + + THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION + FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY + PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF + MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING + WITHOUT LIMITATION THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE + REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE + FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING + OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN + IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + +------------------- + +The pkcs11.h file included in the PKINIT code has the +following license: + + | Copyright 2006 g10 Code GmbH + | Copyright 2006 Andreas Jellinghaus + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + +------------------- + +Portions contributed by Apple Inc. are subject to the following license: + + Copyright 2004-2008 Apple Inc. All Rights Reserved. + + Export of this software from the United States of America may require + a specific license from the United States Government. It is the + responsibility of any person or organization contemplating export to + obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of Apple Inc. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. Apple Inc. makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + + THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +------------------- + +The implementations of UTF-8 string handling in src/util/support and +src/lib/krb5/unicode are subject to the following copyright and +permission notice: + + | The OpenLDAP Public License + | Version 2.8, 17 August 2003 + + Redistribution and use of this software and associated documentation + ("Software"), with or without modification, are permitted provided + that the following conditions are met: + + 1. Redistributions in source form must retain copyright statements + and notices, + 2. Redistributions in binary form must reproduce applicable copyright + statements and notices, this list of conditions, and the following + disclaimer in the documentation and/or other materials provided + with the distribution, and + 3. Redistributions must contain a verbatim copy of this document. + + The OpenLDAP Foundation may revise this license from time to time. + Each revision is distinguished by a version number. You may use + this Software under terms of this license revision or under the + terms of any subsequent revision of the license. + + THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS + CONTRIBUTORS "AS IS" AND ANY EXPRESSED 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 OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S) + OR OWNER(S) OF THE SOFTWARE 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. + + The names of the authors and copyright holders must not be used in + advertising or otherwise to promote the sale, use or other dealing + in this Software without specific, written prior permission. Title + to copyright in this Software shall at all times remain with copyright + holders. + + OpenLDAP is a registered trademark of the OpenLDAP Foundation. + + Copyright 1999-2003 The OpenLDAP Foundation, Redwood City, + California, USA. All Rights Reserved. Permission to copy and + distribute verbatim copies of this document is granted. + +------------------- + +Marked test programs in src/lib/krb5/krb have the following copyright: + + | Copyright |copy| 2006 Kungliga Tekniska Högskola + | (Royal Institute of Technology, Stockholm, Sweden). + | 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. Neither the name of KTH 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 KTH AND ITS 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 KTH OR ITS 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. + +------------------- + +The KCM Mach RPC definition file used on macOS has the following copyright: + + | Copyright |copy| 2009 Kungliga Tekniska Högskola + | (Royal Institute of Technology, Stockholm, Sweden). + | All rights reserved. + + Portions Copyright |copy| 2009 Apple 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: + + 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. + +------------------- + +Portions of the RPC implementation in src/lib/rpc and src/include/gssrpc +have the following copyright and permission notice: + + Copyright |copy| 2010, Oracle America, 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: + + 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. Neither the name of the "Oracle America, Inc." 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. + +------------------- + + Copyright |copy| 2006,2007,2009 + NTT (Nippon Telegraph and Telephone Corporation). 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 as + the first lines of this file unmodified. + 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. + + THIS SOFTWARE IS PROVIDED BY NTT "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 NTT 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. + +------------------- + + Copyright 2000 by Carnegie Mellon University + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Carnegie Mellon + University not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. + + CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR + ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +------------------- + + Copyright |copy| 2002 Naval Research Laboratory (NRL/CCS) + + Permission to use, copy, modify and distribute this software and its + documentation is hereby granted, provided that both the copyright + notice and this permission notice appear in all copies of the software, + derivative works or modified versions, and any portions thereof. + + NRL ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND + DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER + RESULTING FROM THE USE OF THIS SOFTWARE. + +------------------- + + Copyright |copy| 2022 United States Government as represented by the + Secretary of the Navy. 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. + +------------------- + + Copyright |copy| 1991, 1992, 1994 by Cygnus Support. + + Permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation. + Cygnus Support makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + +------------------- + + Copyright |copy| 2006 Secure Endpoints Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +------------------- + + Copyright |copy| 1994 by the University of Southern California + + EXPORT OF THIS SOFTWARE from the United States of America may + require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to copy, modify, and distribute + this software and its documentation in source and binary forms is + hereby granted, provided that any documentation or other materials + related to such distribution or use acknowledge that the software + was developed by the University of Southern California. + + DISCLAIMER OF WARRANTY. THIS SOFTWARE IS PROVIDED "AS IS". The + University of Southern California MAKES NO REPRESENTATIONS OR + WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not + limitation, the University of Southern California MAKES NO + REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY + PARTICULAR PURPOSE. The University of Southern + California shall not be held liable for any liability nor for any + direct, indirect, or consequential damages with respect to any + claim by the user or distributor of the ksu software. + +------------------- + + | Copyright |copy| 1995 + | The President and Fellows of Harvard University + + This code is derived from software contributed to Harvard by + Jeremy Rassen. + + 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. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + + This product includes software developed by the University of + California, Berkeley and its contributors. + + 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + +------------------- + + | Copyright |copy| 2008 by the Massachusetts Institute of Technology. + | Copyright 1995 by Richard P. Basch. All Rights Reserved. + | Copyright 1995 by Lehman Brothers, Inc. All Rights Reserved. + + Export of this software from the United States of America may + require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of Richard P. Basch, Lehman Brothers and M.I.T. not be used + in advertising or publicity pertaining to distribution of the software + without specific, written prior permission. Richard P. Basch, + Lehman Brothers and M.I.T. make no representations about the suitability + of this software for any purpose. It is provided "as is" without + express or implied warranty. + +------------------- + +The following notice applies to ``src/lib/krb5/krb/strptime.c`` and +``src/include/k5-queue.h``. + + | Copyright |copy| 1997, 1998 The NetBSD Foundation, Inc. + | All rights reserved. + + This code was contributed to The NetBSD Foundation by Klaus Klein. + + 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. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + + This product includes software developed by the NetBSD + Foundation, Inc. and its contributors. + + 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + +------------------- + +The following notice applies to Unicode library files in +``src/lib/krb5/unicode``: + + | Copyright 1997, 1998, 1999 Computing Research Labs, + | New Mexico State University + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT + OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------- + +The following notice applies to ``src/util/support/strlcpy.c``: + + Copyright |copy| 1998 Todd C. Miller ``Todd.Miller@courtesan.com`` + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +------------------- + +The following notice applies to ``src/util/profile/argv_parse.c`` and +``src/util/profile/argv_parse.h``: + + Copyright 1999 by Theodore Ts'o. + + Permission to use, copy, modify, and distribute this software for + any purpose with or without fee is hereby granted, provided that + the above copyright notice and this permission notice appear in all + copies. THE SOFTWARE IS PROVIDED "AS IS" AND THEODORE TS'O (THE + AUTHOR) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (Isn't + it sick that the U.S. culture of lawsuit-happy lawyers requires + this kind of disclaimer?) + +------------------- + +The following notice applies to portiions of ``src/lib/rpc`` and +``src/include/gssrpc``: + + Copyright |copy| 2000 The Regents of the University of Michigan. + All rights reserved. + + Copyright |copy| 2000 Dug Song ``dugsong@UMICH.EDU``. + All rights reserved, all wrongs reversed. + + 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. Neither the name of the University 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 "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 REGENTS 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. + +------------------- + +Implementations of the MD4 algorithm are subject to the following +notice: + + Copyright |copy| 1990, RSA Data Security, Inc. All rights reserved. + + License to copy and use this software is granted provided that + it is identified as the "RSA Data Security, Inc. MD4 Message + Digest Algorithm" in all material mentioning or referencing this + software or this function. + + License is also granted to make and use derivative works + provided that such works are identified as "derived from the RSA + Data Security, Inc. MD4 Message Digest Algorithm" in all + material mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning + either the merchantability of this software or the suitability + of this software for any particular purpose. It is provided "as + is" without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + +------------------- + +Implementations of the MD5 algorithm are subject to the following +notice: + + Copyright |copy| 1990, RSA Data Security, Inc. All rights reserved. + + License to copy and use this software is granted provided that + it is identified as the "RSA Data Security, Inc. MD5 Message- + Digest Algorithm" in all material mentioning or referencing this + software or this function. + + License is also granted to make and use derivative works + provided that such works are identified as "derived from the RSA + Data Security, Inc. MD5 Message-Digest Algorithm" in all + material mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning + either the merchantability of this software or the suitability + of this software for any particular purpose. It is provided "as + is" without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + +------------------- + +The following notice applies to ``src/lib/crypto/crypto_tests/t_mddriver.c``: + + Copyright |copy| 1990-2, RSA Data Security, Inc. Created 1990. All + rights reserved. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + +------------------- + +Portions of ``src/lib/krb5`` are subject to the following notice: + + | Copyright |copy| 1994 CyberSAFE Corporation. + | Copyright 1990,1991,2007,2008 by the Massachusetts + Institute of Technology. + | All Rights Reserved. + + Export of this software from the United States of America may + require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of M.I.T. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. Furthermore if you modify this software you must label + your software as modified software and not distribute it in such a + fashion that it might be confused with the original M.I.T. software. + Neither M.I.T., the Open Computing Security Group, nor + CyberSAFE Corporation make any representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + +------------------- + +Portions contributed by PADL Software are subject to the following +license: + + Copyright (c) 2011, PADL Software Pty Ltd. + 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. Neither the name of PADL Software 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 PADL SOFTWARE 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 PADL SOFTWARE 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. + +------------------- + +The bundled libev source code is subject to the following license: + + All files in libev are Copyright (C)2007,2008,2009 Marc Alexander Lehmann. + + 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 + 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. + + Alternatively, the contents of this package may be used under the terms + of the GNU General Public License ("GPL") version 2 or any later version, + in which case the provisions of the GPL are applicable instead of the + above. If you wish to allow the use of your version of this package only + under the terms of the GPL and not to allow others to use your version of + this file under the BSD license, indicate your decision by deleting the + provisions above and replace them with the notice and other provisions + required by the GPL in this and the other files of this package. If you do + not delete the provisions above, a recipient may use your version of this + file under either the BSD or the GPL. + +------------------- + +Files copied from the Intel AESNI Sample Library are subject to the +following license: + + Copyright |copy| 2010, Intel Corporation + 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 of Intel Corporation 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 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. + +------------------- + +The following notice applies to +``src/ccapi/common/win/OldCC/autolock.hxx``: + + Copyright (C) 1998 by Danilo Almeida. 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. + +------------------- + +The following notice applies to portions of +``src/plugins/preauth/spake/edwards25519.c`` and +``src/plugins/preauth/spake/edwards25519_tables.h``: + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +------------------- + +The following notice applies to portions of +``src/plugins/preauth/spake/edwards25519.c``: + +Copyright (c) 2015-2016, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +------------------- + +The following notice applies to files in ``src/tests/fuzzing``: + +Copyright (C) 2024 by Arjun. 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. diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/paths.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..0b649faf99cc66037fc700543bca04308ccad356 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/paths.json @@ -0,0 +1,523 @@ +{ + "paths": [ + { + "_path": "bin/compile_et", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "c781f39303091fe71b9bf1a49a8a748d1e9917b983a9e116216bcce0a853ded7", + "size_in_bytes": 1069 + }, + { + "_path": "bin/krb5-config", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "444c293ecf9cd8343cc2f6ecc14d69402353055058af71b25090b9f417ce197f", + "size_in_bytes": 7187 + }, + { + "_path": "include/com_err.h", + "path_type": "hardlink", + "sha256": "7e7b77b8d2911e8caafa45c6186c4b6f894d565550c19ba262747834c3c6909a", + "size_in_bytes": 1979 + }, + { + "_path": "include/gssapi.h", + "path_type": "hardlink", + "sha256": "6fca7ce46733a4388a45a5816e4b5b2746d68ad3e04f9e2c51463f134cb802fa", + "size_in_bytes": 181 + }, + { + "_path": "include/gssapi/gssapi.h", + "path_type": "hardlink", + "sha256": "0eaba32c81c8399fe54da5c938a47852aedf60ebfe349026d1461636bbbda919", + "size_in_bytes": 30083 + }, + { + "_path": "include/gssapi/gssapi_alloc.h", + "path_type": "hardlink", + "sha256": "59a93b8bdbc477e00144afa0cc3764821e65f9e226526e16a7511a8f0878980c", + "size_in_bytes": 2640 + }, + { + "_path": "include/gssapi/gssapi_ext.h", + "path_type": "hardlink", + "sha256": "8b715bd1741d0c8193b78c5cdc22463923fc132a358fa2558cd8e22c31ff1448", + "size_in_bytes": 21165 + }, + { + "_path": "include/gssapi/gssapi_generic.h", + "path_type": "hardlink", + "sha256": "b264115ba56603ceaad5e6ed5502dba2629959089391a4f18c4266c66befdc54", + "size_in_bytes": 2217 + }, + { + "_path": "include/gssapi/gssapi_krb5.h", + "path_type": "hardlink", + "sha256": "f30cc3a7c09bb79ce5d56f6489f3575e72e89eb197eb07d7f25656b93a6a6e9b", + "size_in_bytes": 12027 + }, + { + "_path": "include/gssapi/mechglue.h", + "path_type": "hardlink", + "sha256": "abb62fd8d3c15ac357900a3f26b92e361e2601c1b921417fafd2b6802df4b1ed", + "size_in_bytes": 1652 + }, + { + "_path": "include/gssrpc/auth.h", + "path_type": "hardlink", + "sha256": "af3fe9408b12c3e2659ce6c028d726c2e11d438f65126d94c9358b284927f697", + "size_in_bytes": 6441 + }, + { + "_path": "include/gssrpc/auth_gss.h", + "path_type": "hardlink", + "sha256": "571caaca9ae5cf6cceec5cf7ff603571e818592c4220d62856ab624eeb25620a", + "size_in_bytes": 4840 + }, + { + "_path": "include/gssrpc/auth_gssapi.h", + "path_type": "hardlink", + "sha256": "d46e4643daf62ebccd16564010df0a445fe5084257c265c57af14a820e16290c", + "size_in_bytes": 4321 + }, + { + "_path": "include/gssrpc/auth_unix.h", + "path_type": "hardlink", + "sha256": "1e42fc6b44a644ca1bb5dd028f72af0e9c30848b4b469412347fdc16aecc9023", + "size_in_bytes": 2896 + }, + { + "_path": "include/gssrpc/clnt.h", + "path_type": "hardlink", + "sha256": "a8fee164851a83432ca5377f85ca317e6e5f68f13a346ec475cf7bea83406926", + "size_in_bytes": 9654 + }, + { + "_path": "include/gssrpc/netdb.h", + "path_type": "hardlink", + "sha256": "94a71c802288f3115e4aeda57bf712703c68362b8adb48cc73ebbaf7b7b993ba", + "size_in_bytes": 2500 + }, + { + "_path": "include/gssrpc/pmap_clnt.h", + "path_type": "hardlink", + "sha256": "76a3d4c6f9d03a0d6fdf5dccbeeedfa60d4e59e7281dabfb403fa283670d578e", + "size_in_bytes": 3429 + }, + { + "_path": "include/gssrpc/pmap_prot.h", + "path_type": "hardlink", + "sha256": "4e60ca35f3f801c5ab8c25e327bcfc4637deac0615036d9ebe9bbca0242e74d2", + "size_in_bytes": 3841 + }, + { + "_path": "include/gssrpc/pmap_rmt.h", + "path_type": "hardlink", + "sha256": "105372661463f05652cb893535de7daa2f7cba2b107e14266c7ee6339077fe0f", + "size_in_bytes": 2303 + }, + { + "_path": "include/gssrpc/rename.h", + "path_type": "hardlink", + "sha256": "8928872ae491aa9bb06d6458898acce19360a01d3f5fbfbeecbda6f328466bb0", + "size_in_bytes": 10034 + }, + { + "_path": "include/gssrpc/rpc.h", + "path_type": "hardlink", + "sha256": "281063f97d45b39913e2f3f9149a36548e2fbe4bb60033e73b0bb61a440f7dff", + "size_in_bytes": 3143 + }, + { + "_path": "include/gssrpc/rpc_msg.h", + "path_type": "hardlink", + "sha256": "7bcccb8567f43012f85a84da462f1e2f70caa19a48bf4e183d67f14155cc59af", + "size_in_bytes": 5107 + }, + { + "_path": "include/gssrpc/svc.h", + "path_type": "hardlink", + "sha256": "6c9ec7e5fea9e12529511a7d57cedebdd4da6b9d8ed18cb8fa70288d8ea0d758", + "size_in_bytes": 11402 + }, + { + "_path": "include/gssrpc/svc_auth.h", + "path_type": "hardlink", + "sha256": "294373f6586daefe7fd8042817c9dfa41e842b2eb5436a211d469c87cdc3bc5e", + "size_in_bytes": 3976 + }, + { + "_path": "include/gssrpc/types.h", + "path_type": "hardlink", + "sha256": "143c13605b46f57b694561b41c2a98c3989085162ad1c592ff2954fbf35df076", + "size_in_bytes": 3628 + }, + { + "_path": "include/gssrpc/xdr.h", + "path_type": "hardlink", + "sha256": "f17ded763631bfb2778db1c597429227d4611020ec0fb9a26ace05745062947e", + "size_in_bytes": 11795 + }, + { + "_path": "include/kadm5/admin.h", + "path_type": "hardlink", + "sha256": "2726f4c6f4a18f516df7f39c5be2613edbfb41b30e9989e7666f8c4abb90ce7f", + "size_in_bytes": 20824 + }, + { + "_path": "include/kadm5/chpass_util_strings.h", + "path_type": "hardlink", + "sha256": "3b8a8166ab5b8862f92b7f97906c8f0e218937450888d95b15f27663fa774a1d", + "size_in_bytes": 1572 + }, + { + "_path": "include/kadm5/kadm_err.h", + "path_type": "hardlink", + "sha256": "9838fa389a65eb3b88a287ff5a40da6d6c885b76065298798679abe3d460741e", + "size_in_bytes": 4430 + }, + { + "_path": "include/kdb.h", + "path_type": "hardlink", + "sha256": "88b597c06ec9c52439827b777e6a738e8307d948ebfa6054db3147d099c380a3", + "size_in_bytes": 65909 + }, + { + "_path": "include/krad.h", + "path_type": "hardlink", + "sha256": "8051765b55adbe1338e01cfded81f079cc474d9b15e7c58c89637d29109902c2", + "size_in_bytes": 9285 + }, + { + "_path": "include/krb5.h", + "path_type": "hardlink", + "sha256": "1fe239732636b4f9cbfd596542b77c5dd60af2d73a1d4df1eb30ba6ebcd9ec78", + "size_in_bytes": 402 + }, + { + "_path": "include/krb5/ccselect_plugin.h", + "path_type": "hardlink", + "sha256": "6eb76ad87680dee03796b0fa1d5fb3586a29668aaa8f71be2d7e4ba8a909c4b9", + "size_in_bytes": 4213 + }, + { + "_path": "include/krb5/certauth_plugin.h", + "path_type": "hardlink", + "sha256": "adab15ce9c17a9f9bec089528767c1b543a979a17e1f773582979f01f7356e85", + "size_in_bytes": 5864 + }, + { + "_path": "include/krb5/clpreauth_plugin.h", + "path_type": "hardlink", + "sha256": "70678ee6705c2304c0074ab6909fac2df8baa47b1e52674b437a79f52a8d72ac", + "size_in_bytes": 15529 + }, + { + "_path": "include/krb5/hostrealm_plugin.h", + "path_type": "hardlink", + "sha256": "acd7ba4437c95d271e7c9cc19fd2097915b52576939c926a1f67837be0b99889", + "size_in_bytes": 5460 + }, + { + "_path": "include/krb5/kadm5_auth_plugin.h", + "path_type": "hardlink", + "sha256": "42b5f38676ed78e23fb4dddd3367edba2dc110b474bc3214312013a8f5d95fb6", + "size_in_bytes": 12881 + }, + { + "_path": "include/krb5/kadm5_hook_plugin.h", + "path_type": "hardlink", + "sha256": "3f3cb5212a7b8861ac7505f9948c7cf90fd07b481e48ade46882fa7e223114f1", + "size_in_bytes": 6380 + }, + { + "_path": "include/krb5/kdcpolicy_plugin.h", + "path_type": "hardlink", + "sha256": "829dd07baf0d80cb1269d8e712612773f26609ef572b8df6297997c7f4f2b1f4", + "size_in_bytes": 5320 + }, + { + "_path": "include/krb5/kdcpreauth_plugin.h", + "path_type": "hardlink", + "sha256": "5aaef7581e1e4d4a7def48bca1b6108af1ced9c22cc4826a30d7d138b0575299", + "size_in_bytes": 18241 + }, + { + "_path": "include/krb5/krb5.h", + "path_type": "hardlink", + "sha256": "7478934ea263e25121f221306383a722088ee1d4a4de6c369aa5954a5437607c", + "size_in_bytes": 350027 + }, + { + "_path": "include/krb5/localauth_plugin.h", + "path_type": "hardlink", + "sha256": "cdc4244abf61807bdfed95d1fe608cf925b4c4c3af4867ad6daced031c1cd8f3", + "size_in_bytes": 5881 + }, + { + "_path": "include/krb5/locate_plugin.h", + "path_type": "hardlink", + "sha256": "d9707d6c03dbf93753d6885db67cd1cb996429563f1568f29adf8cb06f12f2b2", + "size_in_bytes": 2686 + }, + { + "_path": "include/krb5/plugin.h", + "path_type": "hardlink", + "sha256": "5cdbdb19b61e841aa2fe593eb7a69ae1857728e04af15b3551a85c57d670c35d", + "size_in_bytes": 2090 + }, + { + "_path": "include/krb5/preauth_plugin.h", + "path_type": "hardlink", + "sha256": "ab64bd09cd8ebf5588e4445e5de75b8e9c411ef6035b0f4f04c8185df8abfbdf", + "size_in_bytes": 1774 + }, + { + "_path": "include/krb5/pwqual_plugin.h", + "path_type": "hardlink", + "sha256": "5f63d4365b584fd25dbfe565a6c37205ecdf34d6c565fe38b3e2834acae10b53", + "size_in_bytes": 4426 + }, + { + "_path": "include/profile.h", + "path_type": "hardlink", + "sha256": "e528b527d319a68425cf8d9f5819e6c4a559d13574f565904d6cdbc2dad1cc6b", + "size_in_bytes": 12238 + }, + { + "_path": "include/verto-module.h", + "path_type": "hardlink", + "sha256": "a0ca282f254efda89fae75a8d234d1b41a5f422422b5e37d2c56e863626557ca", + "size_in_bytes": 6640 + }, + { + "_path": "include/verto.h", + "path_type": "hardlink", + "sha256": "65975020670bc6a59e96d4c42b4e66e60282696a11469ba85a3ae7bb42a5bc2d", + "size_in_bytes": 19437 + }, + { + "_path": "lib/libcom_err.so", + "path_type": "softlink", + "sha256": "2316662a78565b8838ad9f667dba99f412df95a051be33cc9a083c3010431c62", + "size_in_bytes": 22216 + }, + { + "_path": "lib/libcom_err.so.3", + "path_type": "softlink", + "sha256": "2316662a78565b8838ad9f667dba99f412df95a051be33cc9a083c3010431c62", + "size_in_bytes": 22216 + }, + { + "_path": "lib/libcom_err.so.3.0", + "path_type": "hardlink", + "sha256": "2316662a78565b8838ad9f667dba99f412df95a051be33cc9a083c3010431c62", + "size_in_bytes": 22216 + }, + { + "_path": "lib/libgssapi_krb5.so", + "path_type": "softlink", + "sha256": "5777df692eca424949b68bd6617fd604ec97d464c10070c5387969dad2468b26", + "size_in_bytes": 396504 + }, + { + "_path": "lib/libgssapi_krb5.so.2", + "path_type": "softlink", + "sha256": "5777df692eca424949b68bd6617fd604ec97d464c10070c5387969dad2468b26", + "size_in_bytes": 396504 + }, + { + "_path": "lib/libgssapi_krb5.so.2.2", + "file_mode": "binary", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "5777df692eca424949b68bd6617fd604ec97d464c10070c5387969dad2468b26", + "size_in_bytes": 396504 + }, + { + "_path": "lib/libgssrpc.so", + "path_type": "softlink", + "sha256": "3e0f2cb837726fc31645eb6bf620872c75845fa0110a027dfbdafbb37eb99376", + "size_in_bytes": 147928 + }, + { + "_path": "lib/libgssrpc.so.4", + "path_type": "softlink", + "sha256": "3e0f2cb837726fc31645eb6bf620872c75845fa0110a027dfbdafbb37eb99376", + "size_in_bytes": 147928 + }, + { + "_path": "lib/libgssrpc.so.4.2", + "path_type": "hardlink", + "sha256": "3e0f2cb837726fc31645eb6bf620872c75845fa0110a027dfbdafbb37eb99376", + "size_in_bytes": 147928 + }, + { + "_path": "lib/libk5crypto.so", + "path_type": "softlink", + "sha256": "ea85dc38a740a7514aad8e6de6ec6c4c354cc0efff73cac48cd6c62e05d63595", + "size_in_bytes": 112736 + }, + { + "_path": "lib/libk5crypto.so.3", + "path_type": "softlink", + "sha256": "ea85dc38a740a7514aad8e6de6ec6c4c354cc0efff73cac48cd6c62e05d63595", + "size_in_bytes": 112736 + }, + { + "_path": "lib/libk5crypto.so.3.1", + "path_type": "hardlink", + "sha256": "ea85dc38a740a7514aad8e6de6ec6c4c354cc0efff73cac48cd6c62e05d63595", + "size_in_bytes": 112736 + }, + { + "_path": "lib/libkadm5clnt.so", + "path_type": "softlink", + "sha256": "25cb7bb1ec1c88c71981e47f98a63b9b76f290a69998da97eefeb155517c91b1", + "size_in_bytes": 107712 + }, + { + "_path": "lib/libkadm5clnt_mit.so", + "path_type": "softlink", + "sha256": "25cb7bb1ec1c88c71981e47f98a63b9b76f290a69998da97eefeb155517c91b1", + "size_in_bytes": 107712 + }, + { + "_path": "lib/libkadm5clnt_mit.so.12", + "path_type": "softlink", + "sha256": "25cb7bb1ec1c88c71981e47f98a63b9b76f290a69998da97eefeb155517c91b1", + "size_in_bytes": 107712 + }, + { + "_path": "lib/libkadm5clnt_mit.so.12.0", + "file_mode": "binary", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "25cb7bb1ec1c88c71981e47f98a63b9b76f290a69998da97eefeb155517c91b1", + "size_in_bytes": 107712 + }, + { + "_path": "lib/libkadm5srv.so", + "path_type": "softlink", + "sha256": "e6147a29e05a668711aeb4b8f8401fd1b9a7d954a848fe950d0acd1c1b1792f2", + "size_in_bytes": 139424 + }, + { + "_path": "lib/libkadm5srv_mit.so", + "path_type": "softlink", + "sha256": "e6147a29e05a668711aeb4b8f8401fd1b9a7d954a848fe950d0acd1c1b1792f2", + "size_in_bytes": 139424 + }, + { + "_path": "lib/libkadm5srv_mit.so.12", + "path_type": "softlink", + "sha256": "e6147a29e05a668711aeb4b8f8401fd1b9a7d954a848fe950d0acd1c1b1792f2", + "size_in_bytes": 139424 + }, + { + "_path": "lib/libkadm5srv_mit.so.12.0", + "file_mode": "binary", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "e6147a29e05a668711aeb4b8f8401fd1b9a7d954a848fe950d0acd1c1b1792f2", + "size_in_bytes": 139424 + }, + { + "_path": "lib/libkdb5.so", + "path_type": "softlink", + "sha256": "e4369feac85412c7e8d8d4b1b73dd4d09aa51e6968c5bc93bdff4d0149bab664", + "size_in_bytes": 94744 + }, + { + "_path": "lib/libkdb5.so.10", + "path_type": "softlink", + "sha256": "e4369feac85412c7e8d8d4b1b73dd4d09aa51e6968c5bc93bdff4d0149bab664", + "size_in_bytes": 94744 + }, + { + "_path": "lib/libkdb5.so.10.0", + "file_mode": "binary", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "e4369feac85412c7e8d8d4b1b73dd4d09aa51e6968c5bc93bdff4d0149bab664", + "size_in_bytes": 94744 + }, + { + "_path": "lib/libkrad.so", + "path_type": "softlink", + "sha256": "2530dc371759b4898f7ff871d504d324873486672c19e1366aad923c4e3d1e03", + "size_in_bytes": 52448 + }, + { + "_path": "lib/libkrad.so.0", + "path_type": "softlink", + "sha256": "2530dc371759b4898f7ff871d504d324873486672c19e1366aad923c4e3d1e03", + "size_in_bytes": 52448 + }, + { + "_path": "lib/libkrad.so.0.0", + "path_type": "hardlink", + "sha256": "2530dc371759b4898f7ff871d504d324873486672c19e1366aad923c4e3d1e03", + "size_in_bytes": 52448 + }, + { + "_path": "lib/libkrb5.so", + "path_type": "softlink", + "sha256": "3db6979c09378814851016891851b52563b21b5af3809968d6f918a8e1379abc", + "size_in_bytes": 1046840 + }, + { + "_path": "lib/libkrb5.so.3", + "path_type": "softlink", + "sha256": "3db6979c09378814851016891851b52563b21b5af3809968d6f918a8e1379abc", + "size_in_bytes": 1046840 + }, + { + "_path": "lib/libkrb5.so.3.3", + "file_mode": "binary", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176848925151491/croot/krb5-split_1768489446313/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "3db6979c09378814851016891851b52563b21b5af3809968d6f918a8e1379abc", + "size_in_bytes": 1046840 + }, + { + "_path": "lib/libkrb5support.so", + "path_type": "softlink", + "sha256": "62d3ec8d83d9dd88ba716b123b9fdd21d10b7715d110ebd82c612ff18aaba02b", + "size_in_bytes": 66408 + }, + { + "_path": "lib/libkrb5support.so.0", + "path_type": "softlink", + "sha256": "62d3ec8d83d9dd88ba716b123b9fdd21d10b7715d110ebd82c612ff18aaba02b", + "size_in_bytes": 66408 + }, + { + "_path": "lib/libkrb5support.so.0.1", + "path_type": "hardlink", + "sha256": "62d3ec8d83d9dd88ba716b123b9fdd21d10b7715d110ebd82c612ff18aaba02b", + "size_in_bytes": 66408 + }, + { + "_path": "lib/libverto.so", + "path_type": "softlink", + "sha256": "ee4db37dd2920a1bb02088e846008bd9cd27156c3839786ffea22896bafe1618", + "size_in_bytes": 46608 + }, + { + "_path": "lib/libverto.so.0", + "path_type": "softlink", + "sha256": "ee4db37dd2920a1bb02088e846008bd9cd27156c3839786ffea22896bafe1618", + "size_in_bytes": 46608 + }, + { + "_path": "lib/libverto.so.0.0", + "path_type": "hardlink", + "sha256": "ee4db37dd2920a1bb02088e846008bd9cd27156c3839786ffea22896bafe1618", + "size_in_bytes": 46608 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/build-krb5-split.sh b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/build-krb5-split.sh new file mode 100644 index 0000000000000000000000000000000000000000..28fc6f420db79f6bbff67b4d8dabaf3759047227 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/build-krb5-split.sh @@ -0,0 +1,83 @@ +#!/bin/bash +set -e + +# Always build everything - the file patterns in meta.yaml will determine what gets packaged +echo "=== BUILDING KRB5 (ALL COMPONENTS) ===" + +echo "=== BUILDING KRB5 ===" + +# Set up environment variables +export CPPFLAGS="${CPPFLAGS/-DNDEBUG/} -I${PREFIX}/include" +export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" + +if [[ ${HOST} =~ .*linux.* ]]; then + export LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags" +fi + +# https://github.com/conda-forge/bison-feedstock/issues/7 +export M4="${BUILD_PREFIX}/bin/m4" + +echo "=== CONFIGURING KRB5 ===" + +# Verify source directory exists +if [[ ! -d "src" ]]; then + echo "ERROR: src directory not found" + exit 1 +fi + +pushd src + echo "Running autoreconf..." + autoreconf -i + + echo "Running configure..." + ./configure --prefix=${PREFIX} \ + --host=${HOST} \ + --build=${BUILD} \ + --sysconfdir=${PREFIX}/etc \ + --localstatedir=${PREFIX}/var \ + --runstatedir=${PREFIX}/var/run \ + --without-readline \ + --with-libedit \ + --with-crypto-impl=openssl \ + --with-tls-impl=openssl \ + --without-system-verto \ + --disable-rpath \ + --enable-shared \ + --disable-static \ + --enable-dns-for-realm \ + --with-lmdb \ + --without-ldap + + echo "=== BUILDING KRB5 ===" + echo "Running make with ${CPU_COUNT:-1} jobs..." + make -j${CPU_COUNT:-1} ${VERBOSE_AT} + + echo "=== INSTALLING KRB5 ===" + echo "Running make install..." + make install +popd + +# Remove man pages to save space +rm -rf "${PREFIX}/share/man" + +echo "=== VERIFICATION ===" +echo "Checking critical installed files:" +CRITICAL_FILES=( + "lib/libkrb5${SHLIB_EXT}" + "include/krb5.h" + "include/gssapi.h" + "bin/kinit" + "bin/klist" + "bin/krb5-config" +) + +for file in "${CRITICAL_FILES[@]}"; do + if [[ -f "${PREFIX}/${file}" ]]; then + echo "✓ ${file} found" + else + echo "✗ ERROR: ${file} not found" + exit 1 + fi +done + +echo "=== BUILD COMPLETE ===" diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..65fd477f9da945eda1673449ec143bd5c498971c --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,41 @@ +BUILD: x86_64-conda_el8-linux-gnu +c_compiler: gcc +c_compiler_version: 14.3.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +cxx_compiler_version: 14.3.0 +extend_keys: +- extend_keys +- pin_run_as_build +- ignore_build_only_deps +- ignore_version +fortran_compiler: gfortran +gettext: '0' +ignore_build_only_deps: +- numpy +- python +krb5: '1.21' +libedit: '3.1' +libkrb5: '1.21' +lmdb: '0' +lua: '5' +ncurses: '6' +numpy: '1.26' +openssl: '3' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 +vc: '14' diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/meta.yaml b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8948f3a6b9d865c94bfc82a39b1a65f87c5ddeb6 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/meta.yaml @@ -0,0 +1,124 @@ +# This file created by conda-build 25.1.2 +# ------------------------------------------------ + +package: + name: libkrb5 + version: 1.22.1 +source: + sha256: d7dd1ded54c1c2d3381da4a266935feda6ba6398155720df27e2975bd5a39239 + url: https://github.com/krb5/krb5/archive/krb5-1.22.1-final.tar.gz +build: + ignore_run_exports: + - libedit + - libstdcxx-ng + - lmdb + - ncurses + number: 0 + run_exports: + - libkrb5 >=1.22.1,<1.23.0a0 + string: h6d2bf13_0 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - autoconf 2.71 pl5340h5eee18b_0 + - binutils_impl_linux-64 2.44 h4b9a079_2 + - binutils_linux-64 2.44 hc03a8fd_2 + - bison 3.7.5 h2531618_1 + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2025.12.2 h06a4308_0 + - flex 2.6.4 ha10e3a4_1 + - gcc_impl_linux-64 14.3.0 h4943218_4 + - gcc_linux-64 14.3.0 hda73cce_12 + - gettext 0.21.0 hedfda30_2 + - gxx_impl_linux-64 14.3.0 he634eba_4 + - gxx_linux-64 14.3.0 hca8765c_12 + - icu 73.1 h6a678d5_0 + - kernel-headers_linux-64 4.18.0 h3108a97_1 + - ld_impl_linux-64 2.44 h153f514_2 + - libexpat 2.7.3 h7354ed3_4 + - libffi 3.4.4 h6a678d5_1 + - libgcc 15.2.0 h69a1729_7 + - libgcc-devel_linux-64 14.3.0 he7458c1_104 + - libgcc-ng 15.2.0 h166f726_7 + - libgomp 15.2.0 h4751f2c_7 + - libmpdec 4.0.0 h5eee18b_0 + - libsanitizer 14.3.0 hd4faa28_4 + - libstdcxx 15.2.0 h39759b7_7 + - libstdcxx-devel_linux-64 14.3.0 he7458c1_104 + - libstdcxx-ng 15.2.0 hc03a8fd_7 + - libtool 2.4.7 h6a678d5_0 + - libuuid 1.41.5 h5eee18b_0 + - libxcb 1.17.0 h9b100fa_0 + - libxml2 2.13.9 h2c43086_0 + - libzlib 1.3.1 hb25bd0a_0 + - lz4-c 1.9.4 h6a678d5_1 + - m4 1.4.18 h4e445db_0 + - make 4.2.1 h1bed415_1 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.18 hd6dcaed_0 + - perl 5.42.0 0_h47b2149_perl5 + - pkg-config 0.29.2 h1bed415_8 + - pthread-stubs 0.3 h0ce48e5_1 + - python 3.14.2 h90eec9f_101_cp314 + - python_abi 3.14 2_cp314 + - readline 8.3 hc2a1206_0 + - sqlite 3.51.1 he0a8d7e_0 + - sysroot_linux-64 2.28 h3108a97_1 + - tk 8.6.15 h54e0aa7_0 + - tzdata 2025b h04d1e81_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zlib 1.3.1 hb25bd0a_0 + - zstd 1.5.7 h11fc155_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - ca-certificates 2025.12.2 h06a4308_0 + - libedit 3.1.20230828 h5eee18b_0 + - libgcc 15.2.0 h69a1729_7 + - libgcc-ng 15.2.0 h166f726_7 + - libgomp 15.2.0 h4751f2c_7 + - libstdcxx 15.2.0 h39759b7_7 + - lmdb 0.9.31 hb25bd0a_0 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.18 hd6dcaed_0 + run: + - __glibc >=2.28,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - lmdb + - openssl >=3.0.18,<4.0a0 +test: + commands: + - set -x + - test -f $PREFIX/lib/libkrb5${SHLIB_EXT} + - test -f $PREFIX/include/krb5.h + - test -f $PREFIX/include/gssapi.h + - test -f $PREFIX/include/gssapi/gssapi.h + - test -f $PREFIX/include/krb5/krb5.h + - test -f $PREFIX/bin/krb5-config +about: + description: 'Kerberos is a network authentication protocol. It is designed to provide + strong authentication for client/server applications by using secret-key cryptography. + + ' + dev_url: https://github.com/krb5/krb5 + doc_url: https://web.mit.edu/kerberos/krb5-1.21/doc/index.html + home: https://web.mit.edu/kerberos + license: MIT + license_family: MIT + license_file: doc/notice.rst + summary: A network authentication protocol. +extra: + copy_test_source_files: true + final: true + recipe-maintainers: + - chenghlee + - mariusvniekerk + - mingwandroid + - ocefpaf + - pelson diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.bat b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.bat new file mode 100644 index 0000000000000000000000000000000000000000..61bf0a937133cf09d67fd477028f8af51e9c12d6 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.bat @@ -0,0 +1,107 @@ +@echo off +setlocal enabledelayedexpansion + +echo === BUILDING KRB5 WINDOWS === + +REM Always build everything - the file patterns in meta.yaml will determine what gets packaged +echo === BUILDING KRB5 (ALL COMPONENTS) === + +set NO_LEASH=1 + +REM Finds stdint.h from msinttypes. +set INCLUDE=%LIBRARY_INC%;%INCLUDE% + +REM Set the install path +set KRB_INSTALL_DIR=%LIBRARY_PREFIX% + +REM Need this set or libs/Makefile fails +set VISUALSTUDIOVERSION=%VS_MAJOR%0 + +REM Set environment variables like conda-forge +set KRB_INSTALL_DIR=%LIBRARY_PREFIX% + +REM Fix perl locale warnings +set LC_ALL=C +set LANG=C + +cd src + +echo === CREATING MAKEFILE FOR WINDOWS === +nmake -f Makefile.in prep-windows +if errorlevel 1 ( + echo ERROR: Makefile preparation failed + exit 1 +) + +echo === BUILDING SOURCES === +nmake NODEBUG=1 +if errorlevel 1 ( + echo ERROR: Build failed + exit 1 +) + +echo === INSTALLING === +nmake install NODEBUG=1 +if errorlevel 1 ( + echo ERROR: Install failed + exit 1 +) + +echo === VERIFICATION === +echo Checking critical installed files: +set ERROR_COUNT=0 + +REM Check for executables - use PREFIX which should be the correct install location +if exist "%PREFIX%\Library\bin\kinit.exe" ( + echo ✓ kinit.exe found in Library/bin/ +) else ( + echo ✗ ERROR: kinit.exe not found + set /a ERROR_COUNT+=1 +) + +if exist "%PREFIX%\Library\bin\klist.exe" ( + echo ✓ klist.exe found in Library/bin/ +) else ( + echo ✗ ERROR: klist.exe not found + set /a ERROR_COUNT+=1 +) + +REM Check for additional executables that should be built +if exist "%PREFIX%\Library\bin\kpasswd.exe" ( + echo ✓ kpasswd.exe found in Library/bin/ +) else ( + echo ✗ ERROR: kpasswd.exe not found + set /a ERROR_COUNT+=1 +) + +if exist "%PREFIX%\Library\bin\kswitch.exe" ( + echo ✓ kswitch.exe found in Library/bin/ +) else ( + echo ✗ ERROR: kswitch.exe not found + set /a ERROR_COUNT+=1 +) + +REM Check for DLLs +if exist "%PREFIX%\Library\bin\krb5_64.dll" ( + echo ✓ krb5_64.dll found in Library/bin/ +) else ( + echo ✗ ERROR: krb5_64.dll not found + set /a ERROR_COUNT+=1 +) + +REM Check for headers +if exist "%PREFIX%\Library\include\krb5.h" ( + echo ✓ krb5.h found in Library/include/ +) else ( + echo ✗ ERROR: krb5.h not found + set /a ERROR_COUNT+=1 +) + + + +if %ERROR_COUNT% GTR 0 ( + echo ERROR: %ERROR_COUNT% critical files missing + exit /b 1 +) + +echo === BUILD COMPLETE === diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.sh b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.sh new file mode 100644 index 0000000000000000000000000000000000000000..28fc6f420db79f6bbff67b4d8dabaf3759047227 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/build-krb5-split.sh @@ -0,0 +1,83 @@ +#!/bin/bash +set -e + +# Always build everything - the file patterns in meta.yaml will determine what gets packaged +echo "=== BUILDING KRB5 (ALL COMPONENTS) ===" + +echo "=== BUILDING KRB5 ===" + +# Set up environment variables +export CPPFLAGS="${CPPFLAGS/-DNDEBUG/} -I${PREFIX}/include" +export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" + +if [[ ${HOST} =~ .*linux.* ]]; then + export LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags" +fi + +# https://github.com/conda-forge/bison-feedstock/issues/7 +export M4="${BUILD_PREFIX}/bin/m4" + +echo "=== CONFIGURING KRB5 ===" + +# Verify source directory exists +if [[ ! -d "src" ]]; then + echo "ERROR: src directory not found" + exit 1 +fi + +pushd src + echo "Running autoreconf..." + autoreconf -i + + echo "Running configure..." + ./configure --prefix=${PREFIX} \ + --host=${HOST} \ + --build=${BUILD} \ + --sysconfdir=${PREFIX}/etc \ + --localstatedir=${PREFIX}/var \ + --runstatedir=${PREFIX}/var/run \ + --without-readline \ + --with-libedit \ + --with-crypto-impl=openssl \ + --with-tls-impl=openssl \ + --without-system-verto \ + --disable-rpath \ + --enable-shared \ + --disable-static \ + --enable-dns-for-realm \ + --with-lmdb \ + --without-ldap + + echo "=== BUILDING KRB5 ===" + echo "Running make with ${CPU_COUNT:-1} jobs..." + make -j${CPU_COUNT:-1} ${VERBOSE_AT} + + echo "=== INSTALLING KRB5 ===" + echo "Running make install..." + make install +popd + +# Remove man pages to save space +rm -rf "${PREFIX}/share/man" + +echo "=== VERIFICATION ===" +echo "Checking critical installed files:" +CRITICAL_FILES=( + "lib/libkrb5${SHLIB_EXT}" + "include/krb5.h" + "include/gssapi.h" + "bin/kinit" + "bin/klist" + "bin/krb5-config" +) + +for file in "${CRITICAL_FILES[@]}"; do + if [[ -f "${PREFIX}/${file}" ]]; then + echo "✓ ${file} found" + else + echo "✗ ERROR: ${file} not found" + exit 1 + fi +done + +echo "=== BUILD COMPLETE ===" diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7ecd2f81de84322ea0a7b9f3bd2213f5fd9c3066 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/meta.yaml @@ -0,0 +1,281 @@ +{% set name = "krb5" %} +{% set version = "1.22.1" %} + +# Platform-specific prefixes and suffixes +{% set win_prefix = "Library/" %} +{% set win_suffix = ".exe" %} + +package: + name: {{ name|lower }}-split + version: {{ version }} + +source: + url: https://github.com/krb5/{{ name }}/archive/{{ name }}-{{ version }}-final.tar.gz + sha256: d7dd1ded54c1c2d3381da4a266935feda6ba6398155720df27e2975bd5a39239 + +build: + number: 0 + skip: true # [win and vc<14] + missing_dso_whitelist: + - api-ms-win-core-winrt-error-l1-1-0.dll # [win] + - api-ms-win-core-winrt-l1-1-0.dll # [win] + - api-ms-win-core-winrt-string-l1-1-0.dll # [win] + +requirements: + build: + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - autoconf # [not win] + - bison # [not win] + - gettext # [not win] + - libtool # [unix] + - make # [unix] + - msys2-gawk # [win] + - msys2-posix # [win] + - perl # [win] + - pkg-config # [unix] + - python * # [not win] + host: + - libedit {{ libedit }} # [unix] + - lmdb {{ lmdb }} # [unix] + - openssl {{ openssl }} # [unix] + +outputs: + - name: lib{{ name }} + script: build-krb5-split.sh # [unix] + script: build-krb5-split.bat # [win] + build: + run_exports: + - {{ pin_subpackage('libkrb5', max_pin='x.x') }} + ignore_run_exports: + - libcxx # [osx] + - libedit # [unix] + - libstdcxx-ng # [linux] + - lmdb # [unix] + - ncurses # [unix] + files: + # Libraries - Unix (only krb5 libraries, not executables) + - lib/libcom_err* # [unix] + - lib/libgssapi* # [unix] + - lib/libgssrpc* # [unix] + - lib/libk5crypto* # [unix] + - lib/libkadm5* # [unix] + - lib/libkdb5* # [unix] + - lib/libkrad* # [unix] + - lib/libkrb5* # [unix] + - lib/libkrb5support* # [unix] + - lib/libverto* # [unix] + # Libraries - Windows + - {{ win_prefix }}bin/comerr*.dll # [win] + - {{ win_prefix }}bin/gssapi*.dll # [win] + - {{ win_prefix }}bin/gssrpc*.dll # [win] + - {{ win_prefix }}bin/k5crypto*.dll # [win] + - {{ win_prefix }}bin/k5sprt*.dll # [win] + - {{ win_prefix }}bin/kadm5*.dll # [win] + - {{ win_prefix }}bin/kdb5*.dll # [win] + - {{ win_prefix }}bin/kfwlogon*.dll # [win] + - {{ win_prefix }}bin/krad*.dll # [win] + - {{ win_prefix }}bin/krb5*.dll # [win] + - {{ win_prefix }}bin/krbcc*.dll # [win] + - {{ win_prefix }}bin/leashw*.dll # [win] + - {{ win_prefix }}bin/plugins/preauth/spake*.dll # [win] + - {{ win_prefix }}bin/verto*.dll # [win] + - {{ win_prefix }}bin/xpprof*.dll # [win] + - {{ win_prefix }}bin/krb5_64.dll # [win] + - {{ win_prefix }}lib/comerr*.lib # [win] + - {{ win_prefix }}lib/gssapi*.lib # [win] + - {{ win_prefix }}lib/k5sprt*.lib # [win] + - {{ win_prefix }}lib/kfwlogon*.lib # [win] + - {{ win_prefix }}lib/krb5*.lib # [win] + - {{ win_prefix }}lib/krbcc*.lib # [win] + - {{ win_prefix }}lib/leashw*.lib # [win] + - {{ win_prefix }}lib/xpprof*.lib # [win] + + # Headers - Unix + - include/com_err.h # [unix] + - include/gssapi.h # [unix] + - include/gssapi/ # [unix] + - include/gssrpc/ # [unix] + - include/kadm5/ # [unix] + - include/kdb.h # [unix] + - include/krad.h # [unix] + - include/krb5.h # [unix] + - include/krb5/ # [unix] + - include/profile.h # [unix] + - include/verto-module.h # [unix] + - include/verto.h # [unix] + + # Headers - Windows + - {{ win_prefix }}include/com_err.h # [win] + - {{ win_prefix }}include/gssapi/ # [win] + - {{ win_prefix }}include/krb5.h # [win] + - {{ win_prefix }}include/krb5/ # [win] + - {{ win_prefix }}include/profile.h # [win] + - {{ win_prefix }}include/win-mac.h # [win] + + # Development tools (krb5-config needed for build-time dependencies) + - bin/compile_et # [unix] + - bin/krb5-config # [unix] + - {{ win_prefix }}bin/compile_et.exe # [win] + # Note: krb5-config.exe doesn't exist on Windows (Unix-specific utility) + + + requirements: + build: + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - libtool # [unix] + - bison # [not win] + - autoconf # [not win] + - msys2-posix # [win] + - perl # [win] + - pkg-config # [unix] + - make # [unix] + - python * # [not win] + - gettext # [not win] + - msys2-gawk # [win] + host: + - libedit {{ libedit }} # [unix] + - lmdb {{ lmdb }} # [unix] + - openssl {{ openssl }} # [unix] + run: + - lmdb # [unix] + - openssl # [unix] + test: + commands: + - set -x # [unix] + - test -f $PREFIX/lib/libkrb5${SHLIB_EXT} # [unix] + - test -f $PREFIX/include/krb5.h # [unix] + - test -f $PREFIX/include/gssapi.h # [unix] + - test -f $PREFIX/include/gssapi/gssapi.h # [unix] + - test -f $PREFIX/include/krb5/krb5.h # [unix] + - test -f $PREFIX/bin/krb5-config # [unix] + - echo on # [win] + - if exist "%PREFIX%\\Library\\bin\\krb5_64.dll" (exit 0) else (exit 1) # [win] + - if exist "%PREFIX%\\Library\\include\\krb5.h" (exit 0) else (exit 1) # [win] + + - name: {{ name }} + script: build-krb5-split.sh # [unix] + script: build-krb5-split.bat # [win] + build: + ignore_run_exports: + - libcxx # [osx] + - libstdcxx-ng # [linux] + - lmdb # [unix] + - openssl # [unix] + files: + # Executables - Unix (only executables, not libraries) + - bin/gss-client + - bin/k5srvutil + - bin/kadmin + - bin/kdestroy + - bin/kinit + - bin/klist + - bin/kpasswd + - bin/kswitch + - bin/ktutil + - bin/kvno + - bin/sclient + - bin/sim_client + - bin/uuclient + - sbin/gss-server + - sbin/kadmin.local + - sbin/kadmind + - sbin/kdb5_util + - sbin/kprop + - sbin/kpropd + - sbin/kproplog + - sbin/krb5-send-pr + - sbin/krb5kdc + - sbin/sim_server + - sbin/sserver + - sbin/uuserver + + # Windows executables + - {{ win_prefix }}bin/ccapiserver{{ win_suffix }} + - {{ win_prefix }}bin/gss-client{{ win_suffix }} + - {{ win_prefix }}bin/gss-server{{ win_suffix }} + - {{ win_prefix }}bin/k5srvutil{{ win_suffix }} + - {{ win_prefix }}bin/kadmin.local{{ win_suffix }} + - {{ win_prefix }}bin/kadmin{{ win_suffix }} + - {{ win_prefix }}bin/kadmind{{ win_suffix }} + - {{ win_prefix }}bin/kcpytkt{{ win_suffix }} + - {{ win_prefix }}bin/kdb5_util{{ win_suffix }} + - {{ win_prefix }}bin/kdeltkt{{ win_suffix }} + - {{ win_prefix }}bin/kdestroy{{ win_suffix }} + - {{ win_prefix }}bin/kfwcpcc{{ win_suffix }} + - {{ win_prefix }}bin/kinit{{ win_suffix }} + - {{ win_prefix }}bin/klist{{ win_suffix }} + - {{ win_prefix }}bin/kpasswd{{ win_suffix }} + - {{ win_prefix }}bin/kprop{{ win_suffix }} + - {{ win_prefix }}bin/kpropd{{ win_suffix }} + - {{ win_prefix }}bin/kproplog{{ win_suffix }} + - {{ win_prefix }}bin/krb5-send-pr{{ win_suffix }} + - {{ win_prefix }}bin/krb5kdc{{ win_suffix }} + - {{ win_prefix }}bin/kswitch{{ win_suffix }} + - {{ win_prefix }}bin/ktutil{{ win_suffix }} + - {{ win_prefix }}bin/kvno{{ win_suffix }} + - {{ win_prefix }}bin/mit2ms{{ win_suffix }} + - {{ win_prefix }}bin/ms2mit{{ win_suffix }} + - {{ win_prefix }}bin/sclient{{ win_suffix }} + - {{ win_prefix }}bin/sim_client{{ win_suffix }} + - {{ win_prefix }}bin/sim_server{{ win_suffix }} + - {{ win_prefix }}bin/sserver{{ win_suffix }} + - {{ win_prefix }}bin/uuclient{{ win_suffix }} + - {{ win_prefix }}bin/uuserver{{ win_suffix }} + requirements: + build: + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - autoconf # [not win] + - bison # [not win] + - gettext # [not win] + - libtool # [unix] + - make # [unix] + - msys2-gawk # [win] + - msys2-posix # [win] + - perl # [win] + - pkg-config # [unix] + - python * # [not win] + host: + - libedit {{ libedit }} # [unix] + - lmdb {{ lmdb }} # [unix] + - openssl {{ openssl }} # [unix] + - {{ pin_subpackage('libkrb5', exact=True) }} + run: + - {{ pin_subpackage('libkrb5', exact=True) }} + - libedit # [unix] + test: + commands: + - set -x # [unix] + # Test for key executables + - test -f $PREFIX/bin/kdestroy # [unix] + - test -f $PREFIX/bin/kinit # [unix] + - test -f $PREFIX/bin/klist # [unix] + - test -f $PREFIX/sbin/krb5kdc # [unix] + - echo on # [win] + # Test for Windows executables + - if exist "%PREFIX%\\Library\\bin\\kinit.exe" (exit 0) else (exit 1) # [win] + - if exist "%PREFIX%\\Library\\bin\\klist.exe" (exit 0) else (exit 1) # [win] + +about: + home: https://web.mit.edu/kerberos + license: MIT + license_family: MIT + license_file: doc/notice.rst + summary: A network authentication protocol. + description: | + Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using secret-key cryptography. + doc_url: https://web.mit.edu/kerberos/krb5-1.21/doc/index.html + dev_url: https://github.com/krb5/krb5 + +extra: + recipe-maintainers: + - pelson + - ocefpaf + - mingwandroid + - mariusvniekerk + - chenghlee diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/run_test.py b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0469e8e8023518ccdb15ad03a9d3bc4541a49e64 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/recipe/parent/run_test.py @@ -0,0 +1,19 @@ + +# just load libfreexl using ctypes +import os +import sys +import ctypes +import platform + +bits, linkage = platform.architecture() +bits = bits[:2] + +if sys.platform == 'win32': + libfreexl = ctypes.CDLL('krb5_%s.dll' % bits) +elif sys.platform == 'darwin': + # LD_LIBRARY_PATH not set on OSX or Linux + path = os.path.expandvars('$PREFIX/lib/libkrb5.dylib') + libfreexl = ctypes.CDLL(path) +else: + path = os.path.expandvars('$PREFIX/lib/libkrb5.so') + libfreexl = ctypes.CDLL(path) diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/repodata_record.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..8fa71a629d10ecc250ed738e5b57f18fe9e99b58 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "h6d2bf13_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libstdcxx >=14", + "lmdb", + "openssl >=3.0.18,<4.0a0" + ], + "fn": "libkrb5-1.22.1-h6d2bf13_0.conda", + "license": "MIT", + "license_family": "MIT", + "md5": "82619ec95cc6d12cec07401b3722ce89", + "name": "libkrb5", + "platform": "linux", + "sha256": "f1e8f3db4a01a7939d3eda83b632f7f9d3910ff4a03bcd124df099740509be97", + "size": 808402, + "subdir": "linux-64", + "timestamp": 1768489517000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libkrb5-1.22.1-h6d2bf13_0.conda", + "version": "1.22.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/run_exports.json b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..e8ba7b3f0f28a8675198aea0df42e27dcf46425b --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libkrb5 >=1.22.1,<1.23.0a0"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/test/run_test.sh b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9561bfe0f6002287c9cb8a26fe60bd1569d4bf71 --- /dev/null +++ b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/info/test/run_test.sh @@ -0,0 +1,14 @@ + + +set -ex + + + +set -x +test -f $PREFIX/lib/libkrb5${SHLIB_EXT} +test -f $PREFIX/include/krb5.h +test -f $PREFIX/include/gssapi.h +test -f $PREFIX/include/gssapi/gssapi.h +test -f $PREFIX/include/krb5/krb5.h +test -f $PREFIX/bin/krb5-config +exit 0 diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so new file mode 100644 index 0000000000000000000000000000000000000000..eea5b0c640ea38e6fd4a629ed497a7e628edfabc Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3 new file mode 100644 index 0000000000000000000000000000000000000000..eea5b0c640ea38e6fd4a629ed497a7e628edfabc Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3.0 new file mode 100644 index 0000000000000000000000000000000000000000..eea5b0c640ea38e6fd4a629ed497a7e628edfabc Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libcom_err.so.3.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so new file mode 100644 index 0000000000000000000000000000000000000000..089a466f1ff3e2e471ca22fc062ea98d44851216 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10 new file mode 100644 index 0000000000000000000000000000000000000000..089a466f1ff3e2e471ca22fc062ea98d44851216 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10.0 new file mode 100644 index 0000000000000000000000000000000000000000..089a466f1ff3e2e471ca22fc062ea98d44851216 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkdb5.so.10.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so new file mode 100644 index 0000000000000000000000000000000000000000..0c65874d9b9e8e2359290ce51b0dd0478d37f5f1 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..0c65874d9b9e8e2359290ce51b0dd0478d37f5f1 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..0c65874d9b9e8e2359290ce51b0dd0478d37f5f1 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrad.so.0.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so new file mode 100644 index 0000000000000000000000000000000000000000..9f9633e61f0f8369d3f32adb2d52aa1c48307acf Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..9f9633e61f0f8369d3f32adb2d52aa1c48307acf Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0.1 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0.1 new file mode 100644 index 0000000000000000000000000000000000000000..9f9633e61f0f8369d3f32adb2d52aa1c48307acf Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libkrb5support.so.0.1 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so new file mode 100644 index 0000000000000000000000000000000000000000..016690decb4c780c4695f0777a8767124211a057 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..016690decb4c780c4695f0777a8767124211a057 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0 differ diff --git a/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0.0 b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..016690decb4c780c4695f0777a8767124211a057 Binary files /dev/null and b/miniconda3/pkgs/libkrb5-1.22.1-h6d2bf13_0/lib/libverto.so.0.0 differ diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/c_api.h b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/c_api.h new file mode 100644 index 0000000000000000000000000000000000000000..db460f7297d54b2863b932456bed719ed5114e8a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/c_api.h @@ -0,0 +1,58 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_C_API_H +#define MAMBA_API_C_API_H + +namespace mamba +{ + class Context; + class Configuration; + struct ContextOptions; + class MainExecutor; +} + +#ifdef __cplusplus +extern "C" +{ +#endif + + mamba::MainExecutor* mamba_new_main_executor(); + void mamba_delete_main_executor(mamba::MainExecutor* main_executor); + + mamba::Context* mamba_new_context(mamba::ContextOptions* options); + void mamba_delete_context(mamba::Context* context); + + mamba::Configuration* mamba_new_configuration(mamba::Context* context); + void mamba_delete_configuration(mamba::Configuration* config); + + int mamba_create(mamba::Configuration* config); + + int mamba_install(mamba::Configuration* config); + + int mamba_update(mamba::Configuration* config, int update_all = 0); + + int mamba_remove(mamba::Configuration* config, int remove_all = 0); + + int mamba_list(mamba::Configuration* config, const char* regex = ""); + + int mamba_info(mamba::Configuration* config); + + int mamba_config_list(mamba::Configuration* config); + + int mamba_set_cli_config(mamba::Configuration* config, const char* name, const char* value); + + int mamba_set_config(mamba::Configuration* config, const char* name, const char* value); + + int mamba_clear_config(mamba::Configuration* config, const char* name); + + int mamba_use_conda_root_prefix(mamba::Configuration* config, int force = 0); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/channel_loader.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/channel_loader.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3a74e607833ee8e6adfce88aa59b60c32a5a0475 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/channel_loader.hpp @@ -0,0 +1,50 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_CHANNEL_LOADER_HPP +#define MAMBA_API_CHANNEL_LOADER_HPP + +#include "mamba/core/error_handling.hpp" + +namespace mamba +{ + namespace solver::libsolv + { + class Database; + } + class Context; + class ChannelContext; + class MultiPackageCache; + + /* Brief Creates channels and mirrors objects + * and loads channels. + * + * Creates and stores channels in the ChannelContext, + * and mirrors objects in the Context object. Then + * loads channels, i.e. download repodata.json files + * if they are not cached locally. + */ + auto load_channels( + Context& ctx, + ChannelContext& channel_context, + solver::libsolv::Database& database, + MultiPackageCache& package_caches + ) -> expected_t; + + /* Brief Creates channels and mirrors objects, + * but does not load channels. + * + * Creates and stores channels in the ChannelContext, + * and mirrors objects in the Context object. + */ + void init_channels(Context& context, ChannelContext& channel_context); + void init_channels_from_package_urls( + Context& context, + ChannelContext& channel_context, + const std::vector& specs + ); +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/clean.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/clean.hpp new file mode 100644 index 0000000000000000000000000000000000000000..65e4420d5699d853e9c7ec4a233f877c8a979940 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/clean.hpp @@ -0,0 +1,24 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_CLEAN_HPP +#define MAMBA_API_CLEAN_HPP + +namespace mamba +{ + const int MAMBA_CLEAN_ALL = 1 << 0; + const int MAMBA_CLEAN_INDEX = 1 << 1; + const int MAMBA_CLEAN_PKGS = 1 << 2; + const int MAMBA_CLEAN_TARBALLS = 1 << 3; + const int MAMBA_CLEAN_LOCKS = 1 << 4; + const int MAMBA_CLEAN_TRASH = 1 << 5; + const int MAMBA_CLEAN_FORCE_PKGS_DIRS = 1 << 6; + + class Configuration; + void clean(Configuration& config, int options); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/config.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/config.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9eead83a642781dbda01b8029062bf7dab5a6865 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/config.hpp @@ -0,0 +1,21 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_CONFIG_HPP +#define MAMBA_API_CONFIG_HPP + +namespace mamba +{ + class Configuration; + + void config_describe(Configuration& config); + + void config_list(Configuration& config); + + void config_sources(Configuration& config); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7d37ee7406eb5885e64ec039fbea042c8fab66ee --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration.hpp @@ -0,0 +1,963 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_CONFIGURATION_HPP +#define MAMBA_API_CONFIGURATION_HPP + +#include + +#include + +#include "mamba/api/configuration_impl.hpp" +#include "mamba/api/constants.hpp" +#include "mamba/core/context.hpp" +#include "mamba/core/output.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/util/environment.hpp" + +namespace mamba +{ + class Configuration; + + enum class ConfigurationLevel + { + kApi = 0, + kCli = 1, + kEnvVar = 2, + kFile = 3, + kDefault = 4 + }; + + + enum class RCConfigLevel + { + kSystemDir = 0, + kRootPrefix = 1, + kHomeDir = 2, + kTargetPrefix = 3 + }; +} // mamba + +namespace YAML +{ + template <> + struct convert + { + static Node encode(const mamba::RCConfigLevel& rhs) + { + switch (rhs) + { + case mamba::RCConfigLevel::kHomeDir: + return Node("HomeDir"); + case mamba::RCConfigLevel::kRootPrefix: + return Node("RootPrefix"); + case mamba::RCConfigLevel::kSystemDir: + return Node("SystemDir"); + case mamba::RCConfigLevel::kTargetPrefix: + return Node("TargetPrefix"); + default: + break; + } + return Node(); + } + + static bool decode(const Node& node, mamba::RCConfigLevel& rhs) + { + if (!node.IsScalar()) + { + return false; + } + + auto str = node.as(); + + if (str == "HomeDir") + { + rhs = mamba::RCConfigLevel::kHomeDir; + } + else if (str == "RootPrefix") + { + rhs = mamba::RCConfigLevel::kRootPrefix; + } + else if (str == "SystemDir") + { + rhs = mamba::RCConfigLevel::kSystemDir; + } + else if (str == "TargetPrefix") + { + rhs = mamba::RCConfigLevel::kTargetPrefix; + } + else + { + return false; + } + + return true; + } + }; +} // YAML + +namespace mamba +{ + namespace detail + { + struct ConfigurableImplBase + { + virtual ~ConfigurableImplBase() = default; + + bool rc_configured() const; + bool env_var_configured() const; + bool env_var_active() const; + + virtual bool cli_configured() const = 0; + + virtual void clear_rc_values() = 0; + virtual void clear_cli_value() = 0; + virtual void set_default_value() = 0; + + virtual void set_rc_yaml_value(const YAML::Node& value, const std::string& source) = 0; + virtual void set_rc_yaml_values( + const std::map& values, + const std::vector& sources + ) = 0; + virtual void set_cli_yaml_value(const YAML::Node& value) = 0; + virtual void set_cli_yaml_value(const std::string& value) = 0; + virtual void set_yaml_value(const YAML::Node& value) = 0; + virtual void set_yaml_value(const std::string& value) = 0; + + virtual void compute(int options, const ConfigurationLevel& level) = 0; + + + virtual bool is_valid_serialization(const std::string& value) const = 0; + virtual bool is_sequence() const = 0; + + virtual YAML::Node yaml_value() const = 0; + virtual void dump_json(nlohmann::json& node, const std::string& name) const = 0; + + bool is_config_loading() const; + + std::string m_name; + std::string m_group = "Default"; + std::string m_description = "No description provided"; + std::string m_long_description = ""; + Configuration* m_config = nullptr; + + std::vector m_rc_sources; + std::vector m_sources; + std::vector m_source; + + std::set m_needed_configs; + std::set m_implied_configs; + + bool m_rc_configurable = false; + RCConfigLevel m_rc_configurable_policy = RCConfigLevel::kTargetPrefix; + + bool m_rc_configured = false; + bool m_api_configured = false; + + std::vector m_env_var_names = {}; + + bool m_single_op_lifetime = false; + int m_compute_counter = 0; + bool m_lock = false; + + using post_context_hook_type = std::function; + post_context_hook_type p_post_ctx_hook; + }; + + template + struct ConfigurableImpl : ConfigurableImplBase + { + bool cli_configured() const override; + + void clear_rc_values() override; + void clear_cli_value() override; + void set_default_value() override; + + void set_rc_yaml_value(const YAML::Node& value, const std::string& source) override; + void set_rc_yaml_values( + const std::map& values, + const std::vector& sources + ) override; + void set_cli_yaml_value(const YAML::Node& value) override; + void set_cli_yaml_value(const std::string& value) override; + void set_yaml_value(const YAML::Node& value) override; + void set_yaml_value(const std::string& value) override; + + void compute(int options, const ConfigurationLevel& level) override; + + bool is_valid_serialization(const std::string& value) const override; + bool is_sequence() const override; + + YAML::Node yaml_value() const override; + void dump_json(nlohmann::json& node, const std::string& name) const override; + + void set_rc_value(const T& value, const std::string& source); + void set_rc_values( + const std::map& mapped_values, + const std::vector& sources + ); + void set_value(const T& value); + + using cli_config_type = detail::cli_config; + using cli_storage_type = typename cli_config_type::storage_type; + + std::map m_rc_values; + std::map m_values; + T m_value; + T m_default_value; + cli_config_type m_cli_config; + T* p_context = 0; + + using value_hook_type = std::function; + using post_merge_hook_type = std::function; + + value_hook_type p_default_value_hook; + value_hook_type p_fallback_value_hook; + post_merge_hook_type p_post_merge_hook; + }; + } + + /**************** + * Configurable * + ****************/ + + class Configurable + { + public: + + template + Configurable(const std::string& name, T* context); + + template + Configurable(const std::string& name, const T& init); + + const std::string& name() const; + + const std::string& group() const; + Configurable&& group(const std::string& group); + + const std::string& description() const; + Configurable&& description(const std::string& desc); + + const std::string& long_description() const; + Configurable&& long_description(const std::string& desc); + + const std::vector& sources() const; + const std::vector& source() const; + + const std::set& needed() const; + Configurable&& needs(const std::set& names); + + const std::set& implied() const; + Configurable&& implies(const std::set& names); + + bool rc_configurable() const; + RCConfigLevel rc_configurable_level() const; + Configurable&& set_rc_configurable(RCConfigLevel level = RCConfigLevel::kTargetPrefix); + + bool rc_configured() const; + bool env_var_configured() const; + bool cli_configured() const; + bool api_configured() const; + bool configured() const; + + bool env_var_active() const; + Configurable&& set_env_var_names(const std::vector& names = {}); + + bool has_single_op_lifetime() const; + Configurable&& set_single_op_lifetime(); + + void reset_compute_counter(); + void lock(); + void free(); + bool locked(); + + template + const T& value() const; + + template + T& value(); + + template + const T& cli_value() const; + + template + const std::vector& values() const; + + template + Configurable&& set_rc_value(const T& value, const std::string& source); + + template + Configurable&& set_rc_values( + const std::map& mapped_values, + const std::vector& sources + ); + + template + Configurable&& set_value(const T& value); + + template + Configurable&& set_default_value(const T& value); + + Configurable&& clear_rc_values(); + Configurable&& clear_env_values(); + Configurable&& clear_cli_value(); + Configurable&& clear_api_value(); + Configurable&& clear_values(); + + template + using value_hook_type = typename detail::ConfigurableImpl::value_hook_type; + template + using post_merge_hook_type = typename detail::ConfigurableImpl::post_merge_hook_type; + using post_context_hook_type = detail::ConfigurableImplBase::post_context_hook_type; + + template + Configurable&& set_default_value_hook(value_hook_type hook); + template + Configurable&& set_default_value_hook(T (*hook)()); + template + Configurable&& set_fallback_value_hook(value_hook_type hook); + template + Configurable&& set_fallback_value_hook(T (*hook)()); + template + Configurable&& set_post_merge_hook(post_merge_hook_type hook); + template + Configurable&& set_post_merge_hook(void (*hook)(T&)); + Configurable&& set_post_context_hook(post_context_hook_type hook); + + template + using cli_storage_type = typename detail::ConfigurableImpl::cli_storage_type; + template + Configurable&& set_cli_value(const T& value); + template + cli_storage_type& get_cli_config(); + + Configurable&& set_rc_yaml_value(const YAML::Node& value, const std::string& source); + Configurable&& set_rc_yaml_values( + const std::map& values, + const std::vector& sources + ); + Configurable&& set_cli_yaml_value(const YAML::Node& value); + Configurable&& set_cli_yaml_value(const std::string& value); + Configurable&& set_yaml_value(const YAML::Node& value); + Configurable&& set_yaml_value(const std::string& value); + + Configurable&& + compute(int options = 0, const ConfigurationLevel& level = ConfigurationLevel::kDefault); + + bool is_valid_serialization(const std::string& value) const; + bool is_sequence() const; + + YAML::Node yaml_value() const; + void dump_json(nlohmann::json& node, const std::string& name) const; + + void set_configuration(Configuration& config) + { + p_impl->m_config = &config; + assert(p_impl->m_config); + } + + private: + + template + detail::ConfigurableImpl& get_wrapped(); + + template + const detail::ConfigurableImpl& get_wrapped() const; + + std::unique_ptr p_impl; + }; + + const int MAMBA_SHOW_CONFIG_VALUES = 1 << 0; + const int MAMBA_SHOW_CONFIG_SRCS = 1 << 1; + const int MAMBA_SHOW_CONFIG_DESCS = 1 << 2; + const int MAMBA_SHOW_CONFIG_LONG_DESCS = 1 << 3; + const int MAMBA_SHOW_CONFIG_GROUPS = 1 << 4; + const int MAMBA_SHOW_ALL_CONFIGS = 1 << 5; + const int MAMBA_SHOW_ALL_RC_CONFIGS = 1 << 6; + + /***************** + * Configuration * + * ***************/ + + class Configuration + { + public: + + explicit Configuration(Context& ctx); + ~Configuration(); + + std::map& config(); + const std::map& config() const; + + Configurable& at(const std::string& name); + const Configurable& at(const std::string& name) const; + + using grouped_config_type = std::pair>; + std::vector get_grouped_config() const; + + std::vector sources() const; + std::vector valid_sources() const; + + Context& context() + { + return m_context; + } + + const Context& context() const + { + return m_context; + } + + void set_rc_values(std::vector possible_rc_paths, const RCConfigLevel& level); + + void load(); + + bool is_loading(); + + void clear_rc_values(); + void clear_cli_values(); + void clear_values(); + + /** + * Pop values that should have a single operation lifetime to avoid memory effect + * between multiple operations. + * It corresponds to CLI values in most of the cases, but may also include API + * values if the `Configurable::has_single_op_lifetime` method returns true. + * RC files and environment variables are always overridden when loading the + * configuration. + */ + void operation_teardown(); + + std::string + dump(int opts = MAMBA_SHOW_CONFIG_VALUES, std::vector names = {}) const; + + Configurable& insert(Configurable configurable, bool allow_redefinition = false); + + void reset_configurables(); + + protected: + + Configuration(const Configuration&) = delete; + Configuration& operator=(const Configuration&) = delete; + Configuration(Configuration&&) = delete; + Configuration& operator=(Configuration&&) = delete; + + void set_configurables(); + + void reset_compute_counters(); + + void compute_loading_sequence(); + + void clear_rc_sources(); + + void + add_to_loading_sequence(std::vector& seq, const std::string& name, std::vector&); + + static YAML::Node load_rc_file(const fs::u8path& file); + + static std::vector + compute_default_rc_sources(const Context& context, const RCConfigLevel& level); + + std::vector + get_existing_rc_sources(const std::vector& possible_rc_paths); + + Context& m_context; + + std::vector m_sources; + std::vector m_valid_sources; + std::map m_rc_yaml_nodes_cache; + + bool m_load_lock = false; + + std::map m_config; + std::vector m_config_order, m_loading_sequence; + }; + + /*********************************** + * ConfigurableImpl implementation * + ***********************************/ + + namespace detail + { + auto get_root_prefix() -> fs::u8path; + + template + bool ConfigurableImpl::cli_configured() const + { + return m_cli_config.has_value(); + }; + + template + void ConfigurableImpl::clear_rc_values() + { + this->m_rc_sources.clear(); + m_rc_values.clear(); + this->m_rc_configured = false; + } + + template + void ConfigurableImpl::clear_cli_value() + { + m_cli_config.reset(); + } + + template + void ConfigurableImpl::set_default_value() + { + m_value = m_default_value; + } + + template + void + ConfigurableImpl::set_rc_yaml_value(const YAML::Node& value, const std::string& source) + { + try + { + set_rc_value(value.as(), source); + } + catch (const YAML::Exception& e) + { + LOG_ERROR << "Bad conversion of configurable '" << this->m_name << "' from source '" + << source << "' : " << e.what(); + } + } + + template + void ConfigurableImpl::set_rc_yaml_values( + const std::map& values, + const std::vector& sources + ) + { + std::map converted_values; + for (auto& y : values) + { + converted_values.insert({ y.first, y.second.as() }); + } + set_rc_values(converted_values, sources); + } + + template + void ConfigurableImpl::set_cli_yaml_value(const YAML::Node& value) + { + m_cli_config.storage() = value.as(); + } + + template + void ConfigurableImpl::set_cli_yaml_value(const std::string& value) + { + m_cli_config.storage() = detail::Source::deserialize(value); + } + + template + void ConfigurableImpl::set_yaml_value(const YAML::Node& value) + { + set_value(value.as()); + } + + template + void ConfigurableImpl::set_yaml_value(const std::string& value) + { + try + { + set_value(detail::Source::deserialize(value)); + } + catch (const YAML::Exception& e) + { + LOG_ERROR << "Bad conversion of configurable '" << this->m_name << "' with value '" + << value << "' : " << e.what(); + throw e; + } + } + + template + bool ConfigurableImpl::is_valid_serialization(const std::string& value) const + { + try + { + detail::Source::deserialize(value); + return true; + } + catch (...) + { + return false; + } + } + + template + bool ConfigurableImpl::is_sequence() const + { + return detail::Source::is_sequence(); + } + + template + YAML::Node ConfigurableImpl::yaml_value() const + { + return YAML::Node(m_value); + } + + template + void ConfigurableImpl::dump_json(nlohmann::json& node, const std::string& name) const + { + node[name] = m_value; + } + + template <> + inline void + ConfigurableImpl::dump_json(nlohmann::json& node, const std::string& name) const + { + node[name] = m_value.string(); + } + + template <> + inline void ConfigurableImpl>::dump_json( + nlohmann::json& node, + const std::string& name + ) const + { + std::vector values(m_value.size()); + std::transform( + m_value.begin(), + m_value.end(), + values.begin(), + [](const auto& value) { return value.string(); } + ); + node[name] = values; + } + + template + void ConfigurableImpl::set_rc_value(const T& value, const std::string& source) + { + this->m_rc_sources.push_back(source); + m_rc_values[source] = value; + this->m_rc_configured = true; + } + + template + void ConfigurableImpl::set_rc_values( + const std::map& mapped_values, + const std::vector& sources + ) + { + assert(mapped_values.size() == sources.size()); + this->m_rc_sources.insert(this->m_rc_sources.end(), sources.begin(), sources.end()); + m_rc_values.insert(mapped_values.begin(), mapped_values.end()); + this->m_rc_configured = true; + } + + template + void ConfigurableImpl::set_value(const T& value) + { + m_value = value; + this->m_api_configured = true; + } + + template + void ConfigurableImpl::compute(int options, const ConfigurationLevel& level) + { + assert(m_config); // REVIEW: should this be a if & throw? + + bool hook_disabled = options & MAMBA_CONF_DISABLE_HOOK; + bool force_compute = options & MAMBA_CONF_FORCE_COMPUTE; + + if (force_compute) + { + LOG_TRACE << "Update configurable '" << this->m_name << "'"; + } + else + { + LOG_TRACE << "Compute configurable '" << this->m_name << "'"; + } + + if (!force_compute && ((is_config_loading() && (m_compute_counter > 0)))) + { + throw std::runtime_error( + "Multiple computation of '" + m_name + "' detected during loading sequence." + ); + } + + const auto& ctx = m_config->context(); + m_sources.clear(); + m_values.clear(); + + if (this->m_api_configured && (level >= ConfigurationLevel::kApi)) + { + m_sources.push_back("API"); + m_values.insert({ "API", m_value }); + } + + if (cli_configured() && (level >= ConfigurationLevel::kCli)) + { + m_sources.push_back("CLI"); + m_values.insert({ "CLI", m_cli_config.value() }); + } + + if (env_var_configured() && env_var_active() && (level >= ConfigurationLevel::kEnvVar)) + { + for (const auto& env_var : m_env_var_names) + { + auto env_var_value = util::get_env(env_var); + if (env_var_value) + { + try + { + m_values.insert( + { env_var, detail::Source::deserialize(env_var_value.value()) } + ); + m_sources.push_back(env_var); + } + catch (const YAML::Exception& e) + { + LOG_ERROR << "Bad conversion of configurable '" << this->m_name + << "' from environment variable '" << env_var + << "' with value '" << env_var_value.value() + << "' : " << e.what(); + throw e; + } + } + } + } + + if (rc_configured() && !ctx.src_params.no_rc && (level >= ConfigurationLevel::kFile)) + { + m_sources.insert(m_sources.end(), m_rc_sources.begin(), m_rc_sources.end()); + m_values.insert(m_rc_values.begin(), m_rc_values.end()); + } + + if ((p_default_value_hook != NULL) && (level >= ConfigurationLevel::kDefault)) + { + m_sources.push_back("default"); + m_values.insert({ "default", p_default_value_hook() }); + } + + if (m_sources.empty() && (p_fallback_value_hook != NULL)) + { + m_sources.push_back("fallback"); + m_values.insert({ "fallback", p_fallback_value_hook() }); + } + + if (!m_sources.empty()) + { + detail::Source::merge(m_values, m_sources, m_value, m_source); + } + else + { + m_value = m_default_value; + m_source = detail::Source::default_value(m_default_value); + } + + if (!hook_disabled && (p_post_merge_hook != NULL)) + { + p_post_merge_hook(m_value); + } + + ++m_compute_counter; + if (p_context != nullptr) + { + *p_context = m_value; + } + + if (p_post_ctx_hook != nullptr) + { + p_post_ctx_hook(); + } + } + } + + /******************************* + * Configurable implementation * + *******************************/ + + template + Configurable::Configurable(const std::string& name, T* context) + : p_impl(std::make_unique>()) + { + auto& wrapped = get_wrapped(); + wrapped.m_name = name; + wrapped.m_value = *context; + wrapped.m_default_value = *context; + wrapped.m_source = detail::Source::default_value(*context); + wrapped.p_context = context; + } + + template + Configurable::Configurable(const std::string& name, const T& init) + : p_impl(std::make_unique>()) + { + auto& wrapped = get_wrapped(); + wrapped.m_name = name; + wrapped.m_value = init; + wrapped.m_default_value = init; + wrapped.m_source = detail::Source::default_value(init); + } + + template + const T& Configurable::value() const + { + return const_cast(this)->value(); + } + + template + T& Configurable::value() + { + if (p_impl->is_config_loading() && p_impl->m_compute_counter == 0) + { + throw std::runtime_error("Using '" + name() + "' value without previous computation."); + } + return get_wrapped().m_value; + } + + template + const T& Configurable::cli_value() const + { + if (!cli_configured()) + { + throw std::runtime_error("Trying to get unset CLI value of '" + name() + "'"); + } + + return get_wrapped().m_cli_config.value(); + } + + template + const std::vector& Configurable::values() const + { + return get_wrapped().m_values; + } + + template + Configurable&& Configurable::set_rc_value(const T& value, const std::string& source) + { + get_wrapped().set_rc_value(value, source); + return std::move(*this); + } + + template + Configurable&& Configurable::set_rc_values( + const std::map& mapped_values, + const std::vector& sources + ) + { + get_wrapped().set_rc_values(mapped_values, sources); + return std::move(*this); + } + + template + Configurable&& Configurable::set_value(const T& value) + { + get_wrapped().set_value(value); + return std::move(*this); + } + + template + Configurable&& Configurable::set_default_value(const T& value) + { + auto& wrapped = get_wrapped(); + wrapped.m_default_value = value; + wrapped.m_value = value; + return std::move(*this); + } + + template + Configurable&& Configurable::set_default_value_hook(value_hook_type hook) + { + get_wrapped().p_default_value_hook = hook; + return std::move(*this); + } + + template + Configurable&& Configurable::set_default_value_hook(T (*hook)()) + { + return set_default_value_hook(value_hook_type(hook)); + } + + template + Configurable&& Configurable::set_fallback_value_hook(value_hook_type hook) + { + get_wrapped().p_fallback_value_hook = hook; + return std::move(*this); + } + + template + Configurable&& Configurable::set_fallback_value_hook(T (*hook)()) + { + return set_fallback_value_hook(value_hook_type(hook)); + } + + template + Configurable&& Configurable::set_post_merge_hook(post_merge_hook_type hook) + { + get_wrapped().p_post_merge_hook = hook; + return std::move(*this); + } + + template + Configurable&& Configurable::set_post_merge_hook(void (*hook)(T&)) + { + return set_post_merge_hook(post_merge_hook_type(hook)); + } + + template + Configurable&& Configurable::set_cli_value(const T& value) + { + get_wrapped().m_cli_config = value; + return std::move(*this); + } + + template + auto Configurable::get_cli_config() -> cli_storage_type& + { + return get_wrapped().m_cli_config.m_storage; + } + + template + detail::ConfigurableImpl& Configurable::get_wrapped() + { + try + { + auto& derived = dynamic_cast&>(*p_impl); + return derived; + } + catch (const std::bad_cast& e) + { + LOG_ERROR << "Bad cast of Configurable '" << name() << "'"; + throw e; + } + } + + template + const detail::ConfigurableImpl& Configurable::get_wrapped() const + { + return const_cast(*this).get_wrapped(); + } + + /******************************** + * Configuration implementation * + ********************************/ + + inline Configurable& Configuration::insert(Configurable configurable, bool allow_redefinition) + { + std::string name = configurable.name(); + if (m_config.count(name) == 0) + { + auto [it, success] = m_config.insert({ name, std::move(configurable) }); + it->second.set_configuration(*this); + m_config_order.push_back(name); + } + else + { + if (!allow_redefinition) + { + throw std::runtime_error("Redefinition of configurable '" + name + "' not allowed."); + } + } + + return m_config.at(name); + } + + void use_conda_root_prefix(Configuration& config, bool force = false); +} + +#endif // MAMBA_CONFIG_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration_impl.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration_impl.hpp new file mode 100644 index 0000000000000000000000000000000000000000..45e82424be5307fe30e070728d75b6b3759db14e --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/configuration_impl.hpp @@ -0,0 +1,364 @@ +#ifndef MAMBA_API_CONFIGURATION_IMPL_HPP +#define MAMBA_API_CONFIGURATION_IMPL_HPP + +#include +#include +#include + +#include + +#include "mamba/core/common_types.hpp" +#include "mamba/core/context.hpp" +#include "mamba/fs/filesystem.hpp" + +namespace mamba +{ + namespace detail + { + // Because CLI11 supports std::optional for options but not for flags... + /************** + * cli_config * + **************/ + + template + struct cli_config + { + using storage_type = std::optional; + storage_type m_storage; + + cli_config() = default; + + cli_config(const T& value) + : m_storage(value) + { + } + + storage_type& storage() + { + return m_storage; + } + + bool has_value() const + { + return m_storage.has_value(); + } + + const T& value() const + { + return m_storage.value(); + } + + void reset() + { + m_storage.reset(); + } + }; + + /********************** + * Source declaration * + **********************/ + + template + struct Source + { + static std::vector default_value(const T&) + { + return std::vector({ "default" }); + }; + + static void merge( + const std::map& values, + const std::vector& sources, + T& value, + std::vector& source + ); + + static T deserialize(const std::string& value); + + static bool is_sequence(); + }; + + template + struct Source> + { + static std::vector default_value(const std::vector& init) + { + return std::vector(std::max(1, init.size()), "default"); + }; + + static void merge( + const std::map>& values, + const std::vector& sources, + std::vector& value, + std::vector& source + ); + + static std::vector deserialize(const std::string& value); + + static bool is_sequence(); + }; + + /************************* + * Source implementation * + *************************/ + + template + void Source::merge( + const std::map& values, + const std::vector& sources, + T& value, + std::vector& source + ) + { + source = sources; + value = values.at(sources.front()); + } + + template + T Source::deserialize(const std::string& value) + { + if (value.empty()) + { + return YAML::Node("").as(); + } + else + { + return YAML::Load(value).as(); + } + } + + template + bool Source::is_sequence() + { + return false; + } + + template + void Source>::merge( + const std::map>& values, + const std::vector& sources, + std::vector& value, + std::vector& source + ) + { + value.clear(); + source.clear(); + + for (auto& s : sources) + { + auto& vec = values.at(s); + for (auto& v : vec) + { + auto find_v = std::find(value.begin(), value.end(), v); + + if (find_v == value.end()) + { + value.push_back(v); + source.push_back(s); + } + } + } + } + + template + std::vector Source>::deserialize(const std::string& value) + { + return YAML::Load("[" + value + "]").as>(); + } + + template + bool Source>::is_sequence() + { + return true; + } + } +} + +/**************** + * YAML parsers * + ****************/ + +namespace YAML +{ + template + struct convert> + { + static Node encode(const T& rhs) + { + return Node(rhs.value()); + } + + static bool decode(const Node& node, std::optional& rhs) + { + if (!node.IsScalar()) + { + return false; + } + + rhs = std::optional(node.as()); + return true; + } + }; + + template <> + struct convert + { + static Node encode(const mamba::VerificationLevel& rhs) + { + if (rhs == mamba::VerificationLevel::Disabled) + { + return Node("disabled"); + } + else if (rhs == mamba::VerificationLevel::Warn) + { + return Node("warn"); + } + else if (rhs == mamba::VerificationLevel::Enabled) + { + return Node("enabled"); + } + else + { + return Node(); + } + } + + static bool decode(const Node& node, mamba::VerificationLevel& rhs) + { + if (!node.IsScalar()) + { + return false; + } + + auto str = node.as(); + + if (str == "enabled") + { + rhs = mamba::VerificationLevel::Enabled; + } + else if (str == "warn") + { + rhs = mamba::VerificationLevel::Warn; + } + else if (str == "disabled") + { + rhs = mamba::VerificationLevel::Disabled; + } + else + { + throw std::runtime_error( + "Invalid 'VerificationLevel', should be in {'enabled', 'warn', 'disabled'}" + ); + } + + return true; + } + }; + + template <> + struct convert + { + static Node encode(const mamba::ChannelPriority& rhs) + { + if (rhs == mamba::ChannelPriority::Strict) + { + return Node("strict"); + } + else if (rhs == mamba::ChannelPriority::Flexible) + { + return Node("flexible"); + } + else if (rhs == mamba::ChannelPriority::Disabled) + { + return Node("disabled"); + } + else + { + return Node(); + } + } + + static bool decode(const Node& node, mamba::ChannelPriority& rhs) + { + if (!node.IsScalar()) + { + return false; + } + + auto str = node.as(); + + if (str == "strict") + { + rhs = mamba::ChannelPriority::Strict; + } + else if ((str == "flexible") || (str == "true")) + { + rhs = mamba::ChannelPriority::Flexible; + } + else if (str == "disabled") + { + rhs = mamba::ChannelPriority::Disabled; + } + else + { + return false; + } + + return true; + } + }; + + template <> + struct convert + { + static Node encode(const mamba::fs::u8path& rhs) + { + return Node(rhs.string()); + } + + static bool decode(const Node& node, mamba::fs::u8path& rhs) + { + if (!node.IsScalar()) + { + return false; + } + + rhs = mamba::fs::u8path(node.as()); + return true; + } + }; + + template <> + struct convert + { + private: + + inline static const std::array log_level_names = { + "trace", "debug", "info", "warning", "error", "critical", "off" + }; + + public: + + static Node encode(const mamba::log_level& rhs) + { + return Node(log_level_names[static_cast(rhs)]); + } + + static bool decode(const Node& node, mamba::log_level& rhs) + { + auto name = node.as(); + auto it = std::find(log_level_names.begin(), log_level_names.end(), name); + if (it != log_level_names.end()) + { + rhs = static_cast(it - log_level_names.begin()); + return true; + } + + LOG_ERROR << "Invalid log level, should be in {'critical', 'error', 'warning', 'info', 'debug', 'trace', 'off'} but is '" + << name << "'"; + return false; + } + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/constants.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/constants.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f0130c5a0e3ee5b467fdfa50187899b1dbaa7425 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/constants.hpp @@ -0,0 +1,26 @@ +#ifndef MAMBA_API_CONSTANTS_HPP +#define MAMBA_API_CONSTANTS_HPP + +namespace mamba +{ + const int MAMBA_NO_PREFIX_CHECK = 1 << 0; + const int MAMBA_ALLOW_EXISTING_PREFIX = 1 << 1; + const int MAMBA_ALLOW_MISSING_PREFIX = 1 << 2; + const int MAMBA_ALLOW_NOT_ENV_PREFIX = 1 << 3; + const int MAMBA_EXPECT_EXISTING_PREFIX = 1 << 4; + + const int MAMBA_NOT_ALLOW_EXISTING_PREFIX = 0; + const int MAMBA_NOT_ALLOW_MISSING_PREFIX = 0; + const int MAMBA_NOT_ALLOW_NOT_ENV_PREFIX = 0; + const int MAMBA_NOT_EXPECT_EXISTING_PREFIX = 0; + + const int MAMBA_CONF_FORCE_COMPUTE = 1 << 0; + const int MAMBA_CONF_DISABLE_HOOK = 1 << 1; + + const int MAMBA_FORCE = 1 << 0; + const int MAMBA_REMOVE_FORCE = MAMBA_FORCE; + const int MAMBA_REMOVE_PRUNE = 1 << 1; + const int MAMBA_REMOVE_ALL = 1 << 2; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/create.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/create.hpp new file mode 100644 index 0000000000000000000000000000000000000000..49c3c3abf642d07cb82e922be6f30eec401ee581 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/create.hpp @@ -0,0 +1,30 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_CREATE_HPP +#define MAMBA_API_CREATE_HPP + +#include + +#include "mamba/fs/filesystem.hpp" + +namespace mamba +{ + class Configuration; + + void create(Configuration& config); + + namespace detail + { + void store_platform_config( + const fs::u8path& prefix, + const std::string& platform, + bool& remove_prefix_on_failure + ); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/env.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/env.hpp new file mode 100644 index 0000000000000000000000000000000000000000..580caa4b37c426d9f0dc1c1b93c24c09bcad773d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/env.hpp @@ -0,0 +1,27 @@ +// Copyright (c) 2025, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_ENV_HPP +#define MAMBA_API_ENV_HPP + +#include "mamba/api/configuration.hpp" + +namespace mamba +{ + class ChannelContext; + class Configuration; + class Context; + + void print_envs(Configuration& config); + + namespace detail + { + std::string get_env_name(const Context& ctx, const mamba::fs::u8path& px); + void print_envs_impl(const Configuration& config); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/info.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/info.hpp new file mode 100644 index 0000000000000000000000000000000000000000..998f38f909ad7b630f28893df78313cdc64cced9 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/info.hpp @@ -0,0 +1,28 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_INFO_HPP +#define MAMBA_API_INFO_HPP + +#include + +namespace mamba +{ + class ChannelContext; + class Configuration; + class Context; + + void info(Configuration& config); + + std::string version(); + + namespace detail + { + void print_info(Context& ctx, ChannelContext& channel_context, const Configuration& config); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/install.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/install.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0306e2bcda5a563de669236866736d6757982e3c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/install.hpp @@ -0,0 +1,158 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_INSTALL_HPP +#define MAMBA_API_INSTALL_HPP + +#include +#include +#include +#include + +#include +#include + +#include "mamba/core/history.hpp" +#include "mamba/core/util.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/solver/request.hpp" + +namespace mamba +{ + class Context; + class ChannelContext; + class Configuration; + class PrefixData; + class MultiPackageCache; + + namespace specs + { + class PackageInfo; + } + + void install(Configuration& config); + + void install_revision(Configuration& config, std::size_t revision); + + void install_specs( + Context& ctx, + ChannelContext& channel_context, + const Configuration& config, + const std::vector& specs, + bool create_env = false, + bool remove_prefix_on_failure = false + ); + + auto create_install_request( // + PrefixData& prefix_data, + std::vector specs, + bool freeze_installed + ) -> solver::Request; + + void add_pins_to_request( + solver::Request& request, + const Context& ctx, + PrefixData& prefix_data, + std::vector specs, + bool no_pin, + bool no_py_pin + ); + + void print_request_pins_to(const solver::Request& request, std::ostream& out); + + void install_explicit_specs( + Context& ctx, + ChannelContext& channel_context, + const std::vector& specs, + bool create_env = false, + bool remove_prefix_on_failure = false + ); + void install_lockfile_specs( + Context& ctx, + ChannelContext& channel_context, + const std::string& lockfile_specs, + const std::vector& categories, + bool create_env = false, + bool remove_prefix_on_failure = false + ); + + namespace detail + { + void create_target_directory(const Context& context, const fs::u8path prefix); + + void create_empty_target( + const Context& context, + const fs::u8path& prefix, + const std::map& env_vars, + bool no_env + ); + + void populate_state_file( + const fs::u8path& prefix, + const std::map& env_vars, + bool no_env + ); + + void file_specs_hook(Configuration& config, std::vector& file_specs); + + void channels_hook(Configuration& config, std::vector& channels); + + bool + download_explicit(const std::vector& pkgs, MultiPackageCache& pkg_caches); + + struct other_pkg_mgr_spec + { + std::string pkg_mgr; + std::vector deps; + std::string cwd; + }; + + bool operator==(const other_pkg_mgr_spec& s1, const other_pkg_mgr_spec& s2); + + struct yaml_file_contents + { + std::string name; + std::vector dependencies, channels; + std::map variables; + std::vector others_pkg_mgrs_specs; + }; + + bool eval_selector(const std::string& selector, const std::string& platform); + + yaml_file_contents read_yaml_file( + const Context& ctx, + const std::string& yaml_file, + const std::string& platform, + bool use_uv + ); + + inline void to_json(nlohmann::json&, const other_pkg_mgr_spec&) + { + } + + void install_revision(Context& ctx, ChannelContext& channel_context, std::size_t revision); + } + +} + +namespace YAML +{ + template <> + struct convert + { + static Node encode(const mamba::detail::other_pkg_mgr_spec& /*rhs*/) + { + return Node(); + } + + static bool decode(const Node& /*node*/, mamba::detail::other_pkg_mgr_spec& /*rhs*/) + { + return true; + } + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/list.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/list.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6037eb53627bf2dd8906fb999100528ea33ff73a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/list.hpp @@ -0,0 +1,21 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_LIST_HPP +#define MAMBA_API_LIST_HPP + +#include + +namespace mamba +{ + class ChannelContext; + class Configuration; + class Context; + + void list(Configuration& config, const std::string& regex); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/remove.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/remove.hpp new file mode 100644 index 0000000000000000000000000000000000000000..98c75e659cf5ee80bcf0d033dc1fc1ff7583e190 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/remove.hpp @@ -0,0 +1,42 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_REMOVE_HPP +#define MAMBA_API_REMOVE_HPP + +#include +#include + +#include "mamba/api/constants.hpp" + +namespace mamba +{ + class Context; + class ChannelContext; + class Configuration; + + enum class RemoveResult : int + { + YES = 0, + NO = 1, + EMPTY = 2, + }; + + RemoveResult remove(Configuration& config, int flags = MAMBA_REMOVE_PRUNE); + + namespace detail + { + bool remove_specs( + Context& ctx, + ChannelContext& channel_context, + const std::vector& specs, + bool prune, + bool force + ); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/repoquery.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/repoquery.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4d55661388ebead2e51c4c0406b0db44fffb42e4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/repoquery.hpp @@ -0,0 +1,42 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#include +#include +#include + +#include "mamba/api/configuration.hpp" +#include "mamba/core/query.hpp" + +namespace mamba +{ + enum class QueryResultFormat + { + Json = 0, + Tree = 1, + Table = 2, + Pretty = 3, + RecursiveTable = 4, + }; + + [[nodiscard]] auto make_repoquery( + solver::libsolv::Database& database, + QueryType type, + QueryResultFormat format, + const std::vector& queries, + bool show_all_builds, + const Context::GraphicsParams& graphics_params, + std::ostream& out + ) -> bool; + + [[nodiscard]] auto repoquery( + Configuration& config, + QueryType type, + QueryResultFormat format, + bool use_local, + const std::vector& query + ) -> bool; +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/shell.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/shell.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8e02dcef0cd56cd7c00824031576f977c6f1beaf --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/shell.hpp @@ -0,0 +1,31 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_SHELL_HPP +#define MAMBA_API_SHELL_HPP + +#include +#include + +#include "mamba/core/palette.hpp" +#include "mamba/fs/filesystem.hpp" + +namespace mamba +{ + class Context; + + void shell_init(Context& ctx, const std::string& shell_type, const fs::u8path& prefix); + void shell_deinit(Context& ctx, const std::string& shell_type, const fs::u8path& prefix); + void shell_reinit(Context& ctx, const fs::u8path& prefix); + void shell_hook(Context& ctx, const std::string& shell_type); + void + shell_activate(Context& ctx, const fs::u8path& prefix, const std::string& shell_type, bool stack); + void shell_reactivate(Context& ctx, const std::string& shell_type); + void shell_deactivate(Context& ctx, const std::string& shell_type); + void shell_enable_long_path_support(Palette palette = Palette::no_color()); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/update.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/update.hpp new file mode 100644 index 0000000000000000000000000000000000000000..59695aba54160c6f4878df26571ea76fe7367fc9 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/api/update.hpp @@ -0,0 +1,49 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_API_UPDATE_HPP +#define MAMBA_API_UPDATE_HPP + +namespace mamba +{ + class Configuration; + + enum class UpdateAll : bool + { + No = false, + Yes = true, + }; + + enum class PruneDeps : bool + { + No = false, + Yes = true, + }; + + enum class EnvUpdate : bool // Specific to `env update` command + { + No = false, + Yes = true, + }; + + enum class RemoveNotSpecified : bool // Specific to `env update` command + { + No = false, + Yes = true, + }; + + struct UpdateParams + { + UpdateAll update_all = UpdateAll::No; + PruneDeps prune_deps = PruneDeps::No; + EnvUpdate env_update = EnvUpdate::No; + RemoveNotSpecified remove_not_specified = RemoveNotSpecified::No; + }; + + void update(Configuration& config, const UpdateParams& update_params = {}); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/activation.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/activation.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e2ad98ab20b76557228c7e86e00e381108006ba1 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/activation.hpp @@ -0,0 +1,263 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_ACTIVATION_HPP +#define MAMBA_CORE_ACTIVATION_HPP + +#include +#include +#include +#include + +#include "mamba/fs/filesystem.hpp" + +// TODO write a map that keeps insertion order + +namespace mamba +{ + class Context; + + enum class ActivationType + { + ACTIVATE, + DEACTIVATE, + REACTIVATE + }; + + struct EnvironmentTransform + { + std::string export_path; + std::vector unset_vars; + std::vector> set_vars; + std::vector> export_vars; + std::vector activate_scripts; + std::vector deactivate_scripts; + }; + + class Activator + { + public: + + virtual ~Activator() = default; + + Activator(const Activator&) = delete; + Activator& operator=(const Activator&) = delete; + Activator(Activator&&) = delete; + Activator& operator=(Activator&&) = delete; + + virtual std::string script(const EnvironmentTransform& env) = 0; + virtual std::pair + update_prompt(const std::string& conda_prompt_modifier) = 0; + virtual std::string shell_extension() = 0; + virtual std::string shell() = 0; + + std::vector get_activate_scripts(const fs::u8path& prefix); + std::vector get_deactivate_scripts(const fs::u8path& prefix); + + std::string get_default_env(const fs::u8path& prefix); + std::vector> + get_environment_vars(const fs::u8path& prefix); + + std::string get_prompt_modifier( + const fs::u8path& prefix, + const std::string& conda_default_env, + int old_conda_shlvl + ); + + std::vector get_PATH(); + + std::string add_prefix_to_path(const fs::u8path& prefix, int old_conda_shlvl); + std::string + replace_prefix_in_path(const fs::u8path& old_prefix, const fs::u8path& new_prefix); + std::string remove_prefix_from_path(const fs::u8path& prefix); + + void get_export_unset_vars( + EnvironmentTransform& envt, + const std::vector>& to_export + ); + + EnvironmentTransform build_reactivate(); + EnvironmentTransform build_deactivate(); + EnvironmentTransform build_activate(const fs::u8path& prefix); + + std::string activate(const fs::u8path& prefix, bool stack); + std::string reactivate(); + std::string deactivate(); + + virtual std::string hook_preamble() = 0; + virtual std::string hook_postamble() = 0; + virtual fs::u8path hook_source_path() = 0; + + std::string hook(const std::string& shell_type); + + protected: + + explicit Activator(const Context& context); + + const Context& m_context; + bool m_stack = false; + ActivationType m_action; + + std::unordered_map m_env; + }; + + class PosixActivator : public Activator + { + public: + + explicit PosixActivator(const Context& context) + : Activator(context) + { + } + + virtual ~PosixActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class CshActivator : public Activator + { + public: + + explicit CshActivator(const Context& context) + : Activator(context) + { + } + + virtual ~CshActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class CmdExeActivator : public Activator + { + public: + + explicit CmdExeActivator(const Context& context) + : Activator(context) + { + } + + virtual ~CmdExeActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class PowerShellActivator : public Activator + { + public: + + explicit PowerShellActivator(const Context& context) + : Activator(context) + { + } + + virtual ~PowerShellActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class XonshActivator : public Activator + { + public: + + explicit XonshActivator(const Context& context) + : Activator(context) + { + } + + virtual ~XonshActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class FishActivator : public Activator + { + public: + + explicit FishActivator(const Context& context) + : Activator(context) + { + } + + virtual ~FishActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + + class NuActivator : public Activator + { + public: + + explicit NuActivator(const Context& context) + : Activator(context) + { + } + + virtual ~NuActivator() = default; + + std::string script(const EnvironmentTransform& env_transform) override; + std::pair + update_prompt(const std::string& conda_prompt_modifier) override; + std::string shell_extension() override; + std::string shell() override; + + std::string hook_preamble() override; + std::string hook_postamble() override; + fs::u8path hook_source_path() override; + }; + +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/channel_context.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/channel_context.hpp new file mode 100644 index 0000000000000000000000000000000000000000..98c0fdbef646c4b96ff42b71df87e9669857c3b5 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/channel_context.hpp @@ -0,0 +1,73 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_CHANNEL_HPP +#define MAMBA_CORE_CHANNEL_HPP + +#include +#include + +#include "mamba/specs/channel.hpp" + +namespace mamba +{ + class Context; + + class ChannelContext + { + public: + + using ChannelResolveParams = specs::ChannelResolveParams; + using Channel = specs::Channel; + using channel_list = ChannelResolveParams::channel_list; + + /** + * Create a ChannelContext with a simple parsing of the context options. + * + * No hardcoded names are added. + * Custom channels are treated as aliases rather than the Conda way (the name is not + * added at the end of the URL if absent). + */ + [[nodiscard]] static auto make_simple(const Context& ctx) -> ChannelContext; + + /** + * Create a ChannelContext while applying all of Conda context options. + * + * If not defined, the Conda custom channels "pkgs/main", "pkgs/r", "pkgs/pro", + * and "pkgs/msys2" (Windows only) will be added. + * If not defined, the Conda custom mutlit channels "defaults" and "local" will + * be added. + * The function will ensure custom channels names are added at the end of the URLs. + */ + [[nodiscard]] static auto make_conda_compatible(const Context& ctx) -> ChannelContext; + + /** + * Initialize channel with the parameters as they are. + * + * The Context is not parsed. + */ + ChannelContext(ChannelResolveParams params, std::vector has_zst); + + [[nodiscard]] auto make_channel(specs::UnresolvedChannel uc) -> const channel_list&; + [[nodiscard]] auto make_channel(std::string_view name) -> const channel_list&; + [[nodiscard]] auto + make_channel(std::string_view name, const std::vector& mirrors) + -> const channel_list&; + + [[nodiscard]] auto params() const -> const specs::ChannelResolveParams&; + + [[nodiscard]] auto has_zst(const Channel& chan) const -> bool; + + private: + + using ChannelCache = std::unordered_map; + + ChannelResolveParams m_channel_params; + ChannelCache m_channel_cache; + std::vector m_has_zst; + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/common_types.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/common_types.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3c0c29f381b718743d7455c31d5b8be24c683fa4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/common_types.hpp @@ -0,0 +1,24 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_COMMON_TYPES_HPP +#define MAMBA_CORE_COMMON_TYPES_HPP + +namespace mamba +{ + enum class log_level + { + trace, + debug, + info, + warn, + err, + critical, + off + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fd65a645494fd4b621e8095656a9103271b22f5a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context.hpp @@ -0,0 +1,317 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_CONTEXT_HPP +#define MAMBA_CORE_CONTEXT_HPP + +#include +#include +#include +#include + +#include "mamba/core/common_types.hpp" +#include "mamba/core/context_params.hpp" +#include "mamba/core/palette.hpp" +#include "mamba/core/subdir_parameters.hpp" +#include "mamba/core/tasksync.hpp" +#include "mamba/download/mirror_map.hpp" +#include "mamba/download/parameters.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/solver/libsolv/parameters.hpp" +#include "mamba/solver/request.hpp" +#include "mamba/specs/authentication_info.hpp" +#include "mamba/specs/platform.hpp" +#include "mamba/version.hpp" + +#define ROOT_ENV_NAME "base" + +namespace mamba +{ + enum class VerificationLevel + { + Disabled, + Warn, + Enabled + }; + + struct ValidationParams + { + VerificationLevel safety_checks = VerificationLevel::Warn; + bool extra_safety_checks = false; + bool verify_artifacts = false; + + // TODO Uncomment `conda-forge` or whatever trusted_channels when possible + // (i.e server side package signing ready) + // Remove "http://127.0.0.1:8000/get/channel0" + // (should only be used in integration tests, + // this one is for testing with quetz) + std::vector trusted_channels = { + /*"conda-forge", */ "http://127.0.0.1:8000/get/channel0" + }; + }; + + enum class ChannelPriority + { + Disabled, + Flexible, + Strict + }; + + + class Logger; + class Context; + + struct ContextOptions + { + bool enable_logging = false; + bool enable_signal_handling = false; + }; + + // Context singleton class + class Context + { + public: + + static void use_default_signal_handler(bool val); + + struct OutputParams + { + int verbosity{ 0 }; + log_level logging_level{ log_level::warn }; + + bool json{ false }; + bool quiet{ false }; + + std::string log_pattern{ "%^%-9!l%-8n%$ %v" }; + std::size_t log_backtrace{ 0 }; + }; + + struct GraphicsParams + { + bool no_progress_bars{ false }; + Palette palette; + }; + + struct SrcParams + { + bool no_rc{ false }; + bool no_env{ false }; + }; + + // Configurable + bool experimental = false; + bool experimental_repodata_parsing = true; + bool experimental_matchspec_parsing = false; + bool debug = false; + bool use_uv = false; + + // TODO check writable and add other potential dirs + std::vector envs_dirs; + std::vector pkgs_dirs; + std::optional env_lockfile; + + bool use_index_cache = false; + std::size_t local_repodata_ttl = 1; // take from header + bool offline = false; + + ChannelPriority channel_priority = ChannelPriority::Flexible; + bool auto_activate_base = false; + + bool extract_sparse = false; + + bool dry_run = false; + bool download_only = false; + bool always_yes = false; + + bool register_envs = true; + + bool show_anaconda_channel_warnings = true; + + // solver options + solver::Request::Flags solver_flags = {}; + + // add start menu shortcuts on Windows (not implemented on Linux / macOS) + bool shortcuts = true; + + // debug helpers + bool keep_temp_files = false; + bool keep_temp_directories = false; + + bool change_ps1 = true; + std::string env_prompt = "({default_env}) "; + bool ascii_only = false; + // micromamba only + bool shell_completion = true; + + OutputParams output_params; + GraphicsParams graphics_params; + SrcParams src_params; + CommandParams command_params; + ThreadsParams threads_params; + PrefixParams prefix_params; + ValidationParams validation_params; + LinkParams link_params; + + download::RemoteFetchParams remote_fetch_params = { + .ssl_verify = { "" }, + .ssl_no_revoke = false, + .curl_initialized = false, + .user_agent = { "mamba/" LIBMAMBA_VERSION_STRING }, + .connect_timeout_secs = 10., + .retry_timeout = 2, + .retry_backoff = 3, + .max_retries = 3, + .proxy_servers = {}, + }; + + download::Options download_options() const + { + return { + .download_threads = this->threads_params.download_threads, + .fail_fast = false, + .sort = true, + .verbose = this->output_params.verbosity >= 2, + }; + } + + SubdirParams subdir_params() const + { + const auto get_local_repodata_ttl = [&]() -> std::optional + { + // Force the use of index cache by setting TTL to 0 + if (this->use_index_cache) + { + return { 0 }; + } + // This is legacy where from where 1 meant to read from header + if (this->local_repodata_ttl == 1) + { + return std::nullopt; + } + return { this->local_repodata_ttl }; + }; + + return { + .local_repodata_ttl_s = get_local_repodata_ttl(), + .offline = this->offline, + .repodata_force_use_zst = false // Must override based on ChannelContext + }; + } + + SubdirDownloadParams subdir_download_params() const + { + return { + .offline = this->offline, + .repodata_check_zst = this->repodata_use_zst, + }; + } + + TransactionParams transaction_params() const + { + return { + .is_mamba_exe = command_params.is_mamba_exe, + .json_output = output_params.json, + .verbosity = output_params.verbosity, + .shortcuts = shortcuts, + .envs_dirs = envs_dirs, + .platform = platform, + .prefix_params = prefix_params, + .link_params = link_params, + .threads_params = threads_params, + }; + } + + std::size_t lock_timeout = 0; + bool use_lockfiles = true; + + // Conda compat + bool add_pip_as_python_dependency = true; + + std::string host_platform = std::string(specs::build_platform_name()); + std::string platform = std::string(specs::build_platform_name()); + std::vector platforms() const; + + std::vector channels = { "conda-forge" }; + std::map custom_channels; + std::map> custom_multichannels; + + std::vector default_channels = { +#ifdef _WIN32 + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/msys2" +#else + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r" +#endif + }; + + std::map> mirrored_channels; + std::string channel_alias = "https://conda.anaconda.org"; + specs::AuthenticationDataBase& authentication_info(); + const specs::AuthenticationDataBase& authentication_info() const; + std::vector token_locations{ "~/.continuum/anaconda-client/tokens" }; + + bool override_channels_enabled = true; + + std::vector pinned_packages = {}; + + bool use_only_tar_bz2 = false; + + bool repodata_use_zst = true; + std::vector repodata_has_zst = { "https://conda.anaconda.org/conda-forge" }; + + // FIXME: Should not be stored here + // Notice that we cannot build this map directly from mirrored_channels, + // since we need to add a single "mirror" for non mirrored channels + download::mirror_map mirrors; + + Context(const Context&) = delete; + Context& operator=(const Context&) = delete; + + Context(Context&&) = delete; + Context& operator=(Context&&) = delete; + + void debug_print() const; + void dump_backtrace_no_guards(); + + void set_verbosity(int lvl); + void set_log_level(log_level level); + + Context(const ContextOptions& options = {}); + ~Context(); + + private: + + // Used internally + bool on_ci = false; + + void load_authentication_info(); + specs::AuthenticationDataBase m_authentication_info; + bool m_authentication_infos_loaded = false; + + class ScopedLogger; + std::vector loggers; + + std::shared_ptr main_logger(); + void add_logger(std::shared_ptr); + + TaskSynchronizer tasksync; + + + // Enables the provided context setup signal handling. + // This function must be called only for one Context in the lifetime of the program. + void enable_signal_handling(); + + // Enables the provided context to drive the logging system. + // This function must be called only for one Context in the lifetime of the program. + void enable_logging(); + }; + + +} // namespace mamba + +#endif // MAMBA_CONTEXT_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context_params.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context_params.hpp new file mode 100644 index 0000000000000000000000000000000000000000..136ebcfe620b92da158cf3fc75ed8b52d39f40aa --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/context_params.hpp @@ -0,0 +1,62 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#pragma once + +#include +#include + +#include "mamba/fs/filesystem.hpp" + +// TODO move these structures back to Context.hpp or rename this file +// with a better name when the Context is fully refactored. +namespace mamba +{ + struct CommandParams + { + std::string caller_version{ "" }; + std::string conda_version{ "3.8.0" }; + std::string current_command{ "mamba" }; + /** Is the Context used in a mamba or mamba executable (instead of a lib). */ + bool is_mamba_exe{ false }; + }; + + struct PrefixParams + { + fs::u8path target_prefix; + fs::u8path root_prefix; + fs::u8path conda_prefix; + fs::u8path relocate_prefix; + }; + + struct LinkParams + { + bool allow_softlinks = false; + bool always_copy = false; + bool always_softlink = false; + bool compile_pyc = true; + }; + + struct ThreadsParams + { + std::size_t download_threads{ 5 }; + int extract_threads{ 0 }; + }; + + struct TransactionParams + { + bool is_mamba_exe; + bool json_output; + int verbosity; + bool shortcuts; + std::vector envs_dirs; + std::string platform; + + PrefixParams prefix_params; + LinkParams link_params; + ThreadsParams threads_params; + }; +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/download_progress_bar.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/download_progress_bar.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9dbae146f34db2a1ca734e2403d66cd8dc3189cb --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/download_progress_bar.hpp @@ -0,0 +1,113 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_DOWNLOAD_PROGRESS_BAR_HPP +#define MAMBA_CORE_DOWNLOAD_PROGRESS_BAR_HPP + +#include +#include +#include + +#include "mamba/core/context.hpp" +#include "mamba/core/package_fetcher.hpp" +#include "mamba/download/downloader.hpp" + +namespace mamba +{ + struct MonitorOptions + { + bool checking_download = false; + bool no_clear_progress_bar = false; + }; + + class SubdirIndexMonitor : public download::Monitor + { + public: + + static bool can_monitor(const Context& context); + + explicit SubdirIndexMonitor(MonitorOptions options = {}); + virtual ~SubdirIndexMonitor() = default; + + SubdirIndexMonitor(const SubdirIndexMonitor&) = delete; + SubdirIndexMonitor& operator=(const SubdirIndexMonitor&) = delete; + + SubdirIndexMonitor(SubdirIndexMonitor&&) = delete; + SubdirIndexMonitor& operator=(SubdirIndexMonitor&&) = delete; + + void reset_options(MonitorOptions options); + + private: + + void observe_impl(download::MultiRequest& requests, download::Options& options) override; + void on_done_impl() override; + void on_unexpected_termination_impl() override; + + void update_progress_bar(std::size_t index, const download::Event& event); + void update_progress_bar(std::size_t index, const download::Progress& progress); + void update_progress_bar(std::size_t index, const download::Error& error); + void update_progress_bar(std::size_t index, const download::Success& success); + + void complete_checking_progress_bar(std::size_t index); + + using time_point = std::chrono::steady_clock::time_point; + std::vector m_throttle_time; + std::vector m_progress_bar; + MonitorOptions m_options; + }; + + class PackageDownloadMonitor : public download::Monitor + { + public: + + static bool can_monitor(const Context& context); + + PackageDownloadMonitor() = default; + virtual ~PackageDownloadMonitor(); + + PackageDownloadMonitor(const PackageDownloadMonitor&) = delete; + PackageDownloadMonitor& operator=(const PackageDownloadMonitor&) = delete; + + PackageDownloadMonitor(PackageDownloadMonitor&&) = delete; + PackageDownloadMonitor& operator=(PackageDownloadMonitor&&) = delete; + + // Requires extract_tasks.size() >= requests.size() + // Requires for i in [0, dl_requests.size()), extract_tasks[i].needs_download() + void observe( + download::MultiRequest& dl_requests, + std::vector& extract_tasks, + download::Options& options + ); + + void end_monitoring(); + + private: + + void init_extract_bar(ProgressProxy& extract_bar); + void init_download_bar(ProgressProxy& download_bar); + void init_aggregated_extract(); + void init_aggregated_download(); + + void update_extract_bar(std::size_t index, PackageExtractEvent event); + + void observe_impl(download::MultiRequest& requests, download::Options& options) override; + void on_done_impl() override; + void on_unexpected_termination_impl() override; + + void update_progress_bar(std::size_t index, const download::Event& event); + void update_progress_bar(std::size_t index, const download::Progress& progress); + void update_progress_bar(std::size_t index, const download::Error& error); + void update_progress_bar(std::size_t index, const download::Success& success); + + std::vector m_extract_bar; + + using time_point = std::chrono::steady_clock::time_point; + std::vector m_throttle_time; + std::vector m_download_bar; + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/env_lockfile.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/env_lockfile.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8b4abc001fbb573191efcdcfd75d73f39423a2d2 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/env_lockfile.hpp @@ -0,0 +1,124 @@ +// Copyright (c) 2022, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + + +#ifndef MAMBA_CORE_ENVIRONMENT_LOCKFILE_HPP +#define MAMBA_CORE_ENVIRONMENT_LOCKFILE_HPP + +#include +#include +#include +#include + +#include + +#include "mamba/core/error_handling.hpp" +#include "mamba/core/fsutil.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + class Context; + class ChannelContext; + + enum class file_parsing_error_code + { + unknown_failure, /// Something failed while parsing but we can't identify what. + unsupported_version, /// The version of the file does not matched supported ver. + parsing_failure, /// The content of the file doesnt match the expected format/language + /// structure or constraints. + invalid_data, /// The structure of the data in the file is fine but some fields have + /// invalid values for our purpose. + }; + + struct EnvLockFileError + { + file_parsing_error_code parsing_error_code = file_parsing_error_code::unknown_failure; + std::optional yaml_error_type{}; + + static const EnvLockFileError& get_details(const mamba_error& error) + { + return std::any_cast(error.data()); + } + + template + static mamba_error make_error( + file_parsing_error_code error_code, + StringT&& msg, + std::optional yaml_error_type = std::nullopt + ) + { + return mamba_error{ std::forward(msg), + mamba_error_code::env_lockfile_parsing_failed, + EnvLockFileError{ error_code, yaml_error_type } }; + } + }; + + class EnvironmentLockFile + { + public: + + struct Channel + { + std::string url; + std::vector used_env_vars; + }; + + struct Meta + { + std::unordered_map content_hash; + std::vector channels; + std::vector platforms; + std::vector sources; + }; + + struct Package + { + specs::PackageInfo info; + bool is_optional = false; + std::string category; + std::string manager; + std::string platform; + }; + + EnvironmentLockFile(Meta metadata, std::vector packages) + : m_metadata(std::move(metadata)) + , m_packages(std::move(packages)) + { + } + + std::vector + get_packages_for(std::string_view category, std::string_view platform, std::string_view manager) + const; + + const std::vector& get_all_packages() const + { + return m_packages; + } + + const Meta& get_metadata() const + { + return m_metadata; + } + + private: + + Meta m_metadata; + std::vector m_packages; + }; + + /// Read an environment lock YAML file and returns it's structured content or an error if + /// failed. + tl::expected + read_environment_lockfile(const mamba::fs::u8path& lockfile_location); + + + /// Returns `true` if the filename matches names of files which should be interpreted as conda + /// environment lockfile. NOTE: this does not check if the file exists. + bool is_env_lockfile_name(std::string_view filename); +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/environments_manager.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/environments_manager.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9c8339346cf7ef1fa1840fc1749292d17996b042 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/environments_manager.hpp @@ -0,0 +1,50 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_ENVIRONMENT_MANAGER +#define MAMBA_CORE_ENVIRONMENT_MANAGER + +#include +#include +#include + +#include "fsutil.hpp" + +namespace mamba +{ + class Context; + + const char PREFIX_MAGIC_FILE[] = "conda-meta/history"; + + bool is_conda_environment(const fs::u8path& prefix); + + std::string env_name( + const std::vector& envs_dirs, + const fs::u8path& root_prefix, + const fs::u8path& prefix + ); + + class EnvironmentsManager + { + public: + + explicit EnvironmentsManager(const Context& context); + + void register_env(const fs::u8path& location); + void unregister_env(const fs::u8path& location); + std::set list_all_known_prefixes(); + + private: + + const Context& m_context; + std::set + clean_environments_txt(const fs::u8path& env_txt_file, const fs::u8path& location); + std::string remove_trailing_slash(std::string p); + fs::u8path get_environments_txt_file(const fs::u8path& home) const; + }; +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/error_handling.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/error_handling.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3be2e24f4ff27d9de9f64337e574110353436b14 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/error_handling.hpp @@ -0,0 +1,349 @@ +#ifndef MAMBA_ERROR_HANDLING_HPP +#define MAMBA_ERROR_HANDLING_HPP + +#include +#include +#include +#include + +#include "tl/expected.hpp" + +namespace mamba +{ + + /********************* + * Mamba exceptions * + *********************/ + + enum class mamba_error_code + { + unknown, + aggregated, + prefix_data_not_loaded, + subdirdata_not_loaded, + cache_not_loaded, + repodata_not_loaded, + configurable_bad_cast, + env_lockfile_parsing_failed, + openssl_failed, + internal_failure, + lockfile_failure, + selfupdate_failure, + satisfiablitity_error, + user_interrupted, + incorrect_usage, + invalid_spec, + download_content + }; + + class mamba_error : public std::runtime_error + { + public: + + using base_type = std::runtime_error; + + mamba_error(const std::string& msg, mamba_error_code ec); + mamba_error(const char* msg, mamba_error_code ec); + mamba_error(const std::string& msg, mamba_error_code ec, std::any&& data); + mamba_error(const char* msg, mamba_error_code ec, std::any&& data); + + mamba_error_code error_code() const noexcept; + const std::any& data() const noexcept; + + private: + + mamba_error_code m_error_code; + std::any m_data; + }; + + class mamba_aggregated_error : public mamba_error + { + public: + + using base_type = mamba_error; + using error_list_t = std::vector; + + explicit mamba_aggregated_error(error_list_t&& error_list); + + const char* what() const noexcept override; + + private: + + error_list_t m_error_list; + mutable std::string m_aggregated_message; + static constexpr const char* m_base_message = "Multiple errors occurred:\n"; + }; + + /******************************** + * wrappers around tl::expected * + ********************************/ + + template + class expected_ref_wrapper : private tl::expected, E> + { + public: + + using value_type = T; + using self_type = expected_ref_wrapper; + using reference = std::reference_wrapper; + using base_type = tl::expected; + + using base_type::base_type; + using base_type::operator=; + using base_type::emplace; + using base_type::error; + using base_type::operator bool; + using base_type::has_value; + + constexpr void swap(self_type& rhs) noexcept; + + constexpr const T* operator->() const noexcept; + constexpr T* operator->() noexcept; + constexpr const T& operator*() const& noexcept; + constexpr T& operator*() & noexcept; + constexpr const T&& operator*() const&& noexcept; + constexpr T&& operator*() && noexcept; + + constexpr T& value() &; + constexpr const T&& value() const&&; + constexpr T&& value() &&; + + template + constexpr T value_or(U&&) const&; + template + constexpr T value_or(U&&) &&; + + template + friend constexpr bool operator==(const self_type& x, const expected_ref_wrapper& y); + + template + friend constexpr bool operator==(const self_type&, const T2&); + + template + friend constexpr bool operator==(const self_type&, const tl::unexpected&); + }; + + namespace detail + { + template + struct get_expected + { + using type = tl::expected; + }; + + template + struct get_expected + { + using type = expected_ref_wrapper; + }; + } + + template + using expected_t = typename detail::get_expected::type; + + /******************** + * helper functions * + ********************/ + + tl::unexpected make_unexpected(const char* msg, mamba_error_code ec); + + tl::unexpected make_unexpected(const std::string& msg, mamba_error_code sc); + + tl::unexpected make_unexpected(std::vector&& error_list); + + template + tl::unexpected forward_error(const tl::expected& exp); + + template + tl::unexpected forward_error(const expected_ref_wrapper& exp); + + template + T& extract(tl::expected& exp); + + template + const T& extract(const tl::expected& exp); + + template + T&& extract(tl::expected&& exp); + + template + T& extract(expected_ref_wrapper& exp); + + template + const T& extract(const expected_ref_wrapper& exp); + + template + T&& extract(expected_ref_wrapper&& exp); + + /*************************************** + * expected_ref_wrapper implementation * + ***************************************/ + + template + constexpr void expected_ref_wrapper::swap(self_type& rhs) noexcept + { + base_type::swap(rhs); + } + + template + constexpr const T* expected_ref_wrapper::operator->() const noexcept + { + return &(base_type::operator->()->get()); + } + + template + constexpr T* expected_ref_wrapper::operator->() noexcept + { + return &(base_type::operator->()->get()); + } + + template + constexpr const T& expected_ref_wrapper::operator*() const& noexcept + { + return base_type::operator*().get(); + } + + template + constexpr T& expected_ref_wrapper::operator*() & noexcept + { + return base_type::operator*().get(); + } + + template + constexpr const T&& expected_ref_wrapper::operator*() const&& noexcept + { + return std::move(base_type::operator*().get()); + } + + template + constexpr T&& expected_ref_wrapper::operator*() && noexcept + { + return std::move(base_type::operator*().get()); + } + + template + constexpr T& expected_ref_wrapper::value() & + { + return base_type::value().get(); + } + + template + constexpr const T&& expected_ref_wrapper::value() const&& + { + return std::move(base_type::value().get()); + } + + template + constexpr T&& expected_ref_wrapper::value() && + { + return std::move(base_type::value().get()); + } + + template + template + constexpr T expected_ref_wrapper::value_or(U&& u) const& + { + return base_type::value_or(std::move(u)).get(); + } + + template + template + constexpr T expected_ref_wrapper::value_or(U&& u) && + { + return base_type::value_or(std::move(u)).get(); + } + + template + constexpr bool + operator==(const expected_ref_wrapper& x, const expected_ref_wrapper& y) + { + using base_type1 = typename expected_ref_wrapper::base_type; + using base_type2 = typename expected_ref_wrapper::base_type; + return operator==(static_cast(x), static_cast(y)); + } + + template + constexpr bool operator==(const expected_ref_wrapper& x, const T2& y) + { + using base_type1 = typename expected_ref_wrapper::base_type; + return operator==(static_cast(x), y); + } + + template + constexpr bool operator==(const expected_ref_wrapper& x, const tl::unexpected& y) + { + using base_type1 = typename expected_ref_wrapper::base_type; + return operator==(static_cast(x), y); + } + + /*********************************** + * helper functions implementation * + ***********************************/ + + template + tl::unexpected forward_error(const tl::expected& exp) + { + return tl::make_unexpected(exp.error()); + } + + template + tl::unexpected forward_error(const expected_ref_wrapper& exp) + { + return tl::make_unexpected(exp.error()); + } + + namespace detail + { + template + decltype(auto) extract_impl(T&& exp) + { + if (exp) + { + return std::forward(exp).value(); + } + else + { + throw exp.error(); + } + } + } + + template + T& extract(tl::expected& exp) + { + return detail::extract_impl(exp); + } + + template + const T& extract(const tl::expected& exp) + { + return detail::extract_impl(exp); + } + + template + T&& extract(tl::expected&& exp) + { + return detail::extract_impl(std::move(exp)); + } + + template + T& extract(expected_ref_wrapper& exp) + { + return detail::extract_impl(exp); + } + + template + const T& extract(const expected_ref_wrapper& exp) + { + return detail::extract_impl(exp); + } + + template + T&& extract(expected_ref_wrapper&& exp) + { + return detail::extract_impl(std::move(exp)); + } + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/execution.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/execution.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fda57dc987ae5f6e8eee2e38afd7f3e077ca8daa --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/execution.hpp @@ -0,0 +1,158 @@ +// Copyright (c) 2022, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_EXECUTION_HPP +#define MAMBA_CORE_EXECUTION_HPP + +#include +#include +#include +#include +#include + +#include "mamba/core/error_handling.hpp" +#include "mamba/util/synchronized_value.hpp" + +namespace mamba +{ + struct MainExecutorError : public mamba_error + { + using mamba_error::mamba_error; + }; + + // Main execution resource (for example threads) handler for this library. + // Allows scoping the lifetime of threads being used by the library. + // The user code can either create an instance of this type to determine + // itself the lifetime of the threads, or it can just use `MainExecutor::instance()` + // to obtain a global static instance. In this last case, `MainExecutor::instance().close()` + // have to be called before the end of `main()` to avoid undefined behaviors. + // WARNING: this is a temporary solution designed to evolve, the current implementation + // uses threads directly, a future implementation will use a thread-pool or other similar + // mechanisms. + class MainExecutor + { + public: + + // Set itself as the main executor. + // Throws `MainExecutorError` if another instance already exists. + MainExecutor(); + + // Closes (see `close()`) and unregister itself as the main executor. + // Blocks until all scheduled tasks are done and all resources are released (threads + // joined). + ~MainExecutor(); + + // Returns a reference to the current main executor. + // If no main executor have been set previously to this call, + // a global one is created and returned. In this case the user must + // call `MainExecutor::instance().close()` before the end of `main()` to avoid + // undefined behaviors. + static MainExecutor& instance(); + + // If the default (global) main executor is being used, close and destroy it. + // Do nothing otherwise. + // This is mostly used for testing and libraries using the default main executor. + static void stop_default(); + + // Schedules a task for execution. + // The task must be a callable which takes either the provided arguments or none. + // If this executor is open, the task is scheduled for execution and will be called + // as soon as execution resources are available. The call to the task is not guaranteed + // to have been done at the end of the execution of this function, nor before. + // If this executor is closed, the task is ignored and no code will be executed nor the task + // be called. + template + void schedule(Task&& task, Args&&... args) + { + if (!is_open) + { + return; + } + + auto synched_threads = threads.synchronize(); + if (is_open) // Double check necessary for correctness + { + synched_threads->emplace_back(std::forward(task), std::forward(args)...); + } + } + + // Moves ownership of a thread into this executor. + // This is used in case a thread needs to be manipulated in a particular way, + // but we still want to avoid having to use `std::thread::detach()`. By + // transferring the ownership of the thread to this executor, we are guaranteed that + // the thread will be joined before the end of the lifetime of this executor. + // If this executor is closed, no code will be executed and the thread will be destroyed, + // resulting in a call to `std::terminate()` if the thread is not already joined. + void take_ownership(std::thread thread) + { + if (!thread.joinable() || !is_open) + { + return; + } + + auto synched_threads = threads.synchronize(); + if (is_open) // Double check necessary for correctness + { + synched_threads->push_back(std::move(thread)); + } + } + + // Closes this executor: + // Only returns once all tasks scheduled before this call are finished + // and all owned execution resources (aka threads) are released. + // Note that if any task never ends, this function will never end either. + // Once called this function makes all other functions no-op, even before returning, to + // prevent running tasks from scheduling more tasks to run. This is should be used to + // manually determine the lifetime of the executor's resources. + void close() + { + bool expected = true; + if (!is_open.compare_exchange_strong(expected, false)) + { + return; + } + + invoke_close_handlers(); + + auto synched_threads = threads.synchronize(); + for (auto&& t : *synched_threads) + { + t.join(); + } + synched_threads->clear(); + } + + using on_close_handler = std::function; + + void on_close(on_close_handler handler) + { + if (!is_open) + { + return; + } + + auto handlers = close_handlers.synchronize(); + if (is_open) // Double check needed to avoid adding new handles while closing. + { + handlers->push_back(std::move(handler)); + } + } + + private: + + std::atomic is_open{ true }; + using Threads = std::vector; + using CloseHandlers = std::vector; + util::synchronized_value threads; + util::synchronized_value close_handlers; + + void invoke_close_handlers(); + }; + + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/fsutil.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/fsutil.hpp new file mode 100644 index 0000000000000000000000000000000000000000..51df18879399dabb827eabddfafbe4e9d2c30e93 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/fsutil.hpp @@ -0,0 +1,49 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_FS_UTIL +#define MAMBA_CORE_FS_UTIL + +#include + +namespace mamba +{ + namespace fs + { + class u8path; + } + + namespace path + { + bool starts_with_home(const fs::u8path& p); + + void create_directories_sudo_safe(const fs::u8path& path); + bool touch(const fs::u8path& path, bool mkdir = false, bool sudo_safe = false); + + /** + * Returns `true` only if the provided path is either: + * - a file we are able to open for writing; + * - a directory we are able to create a file in for writing; + * - a file name that does not exist but the parent directory in the path exists and we + * are able to create a file with that name in that directory for writing. + * Returns `false` otherwise. + */ + bool is_writable(const fs::u8path& path) noexcept; + } + + namespace mamba_fs + { + /** Like std::rename, but works across file systems by moving the file instead + * if the rename fails. + * if both rename and move fail, the error code is set to the error code of the + * copy_file operation and the `to` file is removed. You will have to handle removal + * of the `from` file yourself. + */ + void rename_or_move(const fs::u8path& from, const fs::u8path& to, std::error_code& ec); + + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/history.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/history.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5aa79b85c146e83a6a20e0c2fa51750a89a6452a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/history.hpp @@ -0,0 +1,97 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_HISTORY +#define MAMBA_CORE_HISTORY + +#include +#include +#include + +#include "mamba/core/channel_context.hpp" +#include "mamba/core/context_params.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/specs/match_spec.hpp" +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + class History + { + public: + + History(const fs::u8path& prefix, ChannelContext& channel_context); + + struct ParseResult + { + std::string head_line; + std::vector diff; + std::vector comments; + }; + + struct UserRequest + { + static UserRequest prefilled(const CommandParams& command_params); + + std::string date; + std::size_t revision_num = 0; + std::string cmd; + std::string conda_version; + + std::vector unlink_dists; + std::vector link_dists; + + std::vector update; + std::vector remove; + std::vector neutered; + }; + + std::vector parse(); + bool parse_comment_line(const std::string& line, UserRequest& req); + std::vector get_user_requests(); + std::unordered_map get_requested_specs_map(); + void add_entry(const History::UserRequest& entry); + + fs::u8path m_prefix; + fs::u8path m_history_file_path; + ChannelContext& m_channel_context; + }; + + /** PackageDiff contains two maps of packages and their package info, one being for the + * installed packages, the other for the removed ones. This is used while looping on + * revisions to get the diff between the target revision and the current one. + */ + struct PackageDiff + { + using package_diff_map = std::unordered_map; + package_diff_map removed_pkg_diff; + package_diff_map installed_pkg_diff; + + [[nodiscard]] static PackageDiff + from_revision(const std::vector& user_requests, std::size_t target_revision); + }; + + /** The following function parses the different formats that can be found in the history + * file. + * + * conda/mamba1 format: + * + * installed: +conda-forge/linux-64::xtl-0.8.0-h84d6215_0 + * removed: -conda-forge/linux-64::xtl-0.8.0-h84d6215_0 + * + * mamba2 broken format: + * + * installed: +conda-forge::xtl-0.8.0-h84d6215_0 + * removed: -https://conda.anaconda.org/conda-forge/linux-64::xtl-0.8.0-h84d6215_0 + * + * mamba2 new format: + * installed: +https://conda.anaconda.org/conda-forge/linux-64::xtl-0.8.0-h84d6215_0 + * removed: -https://conda.anaconda.org/conda-forge/linux-64::xtl-0.8.0-h84d6215_0 + */ + specs::PackageInfo read_history_url_entry(const std::string& s); +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/invoke.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/invoke.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c8724425bd67e29cd3f408571c7304a344c44c98 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/invoke.hpp @@ -0,0 +1,51 @@ +#ifndef MAMBA_INVOKE_HPP +#define MAMBA_INVOKE_HPP + +#include + +#include "mamba/core/error_handling.hpp" + +namespace mamba +{ + + template + auto safe_invoke(Func&& func, Args&&... args) + -> tl::expected(func), std::forward(args)...)), mamba_error> + { + try + { + // If the callable is passed by being moved-in (r-value reference/temporary etc.) + // we make sure that the lifetime of that callable doesnt go beyond this block. + auto call = [&, callable = std::forward(func)] + { return std::invoke(callable, std::forward(args)...); }; + using Result = decltype(call()); + + if constexpr (std::is_void::value) + { + call(); + return {}; + } + else + { + return call(); + } + } + catch (const std::runtime_error& err) + { + return make_unexpected( + std::string("callback invocation failed : ") + err.what(), + mamba_error_code::unknown + ); + } + catch (...) + { + return make_unexpected( + "callback invocation failed : unknown error", + mamba_error_code::unknown + ); + } + } + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/menuinst.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/menuinst.hpp new file mode 100644 index 0000000000000000000000000000000000000000..21268562a13e96e5556e02cba006563e9c6a3b7c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/menuinst.hpp @@ -0,0 +1,20 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +namespace mamba +{ + class TransactionContext; + + namespace fs + { + class u8path; + } + + void + remove_menu_from_json(const fs::u8path& json_file, const TransactionContext& transaction_context); + void + create_menu_from_json(const fs::u8path& json_file, const TransactionContext& transaction_context); +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/output.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/output.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae13e430723208f03ba5591f09cda0a69b6fb3d3 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/output.hpp @@ -0,0 +1,208 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_OUTPUT_HPP +#define MAMBA_CORE_OUTPUT_HPP + +#include +#include +#include +#include +#include + +#include +#include + +#include "mamba/core/common_types.hpp" +#include "mamba/core/progress_bar.hpp" + +namespace mamba +{ + class Context; + + std::string cut_repo_name(std::string_view reponame); + + namespace printers + { + struct FormattedString + { + std::string s; + fmt::text_style style = {}; + + FormattedString() = default; + + inline FormattedString(const std::string& i) + : s(i) + { + } + + inline FormattedString(const std::string_view i) + : s(i) + { + } + + inline FormattedString(const char* i) + : s(i) + { + } + + inline std::size_t size() const + { + return s.size(); + } + }; + + enum class alignment + { + left, + right, + }; + + constexpr auto alignmentMarker(alignment a) -> std::string_view + { + switch (a) + { + case alignment::right: + return "alignment_right"; + case alignment::left: + return "alignment_right"; + default: + assert(false); + return ""; + } + } + + class Table + { + public: + + Table(const std::vector& header); + + void set_alignment(const std::vector& a); + void set_padding(const std::vector& p); + void add_row(const std::vector& r); + void + add_rows(const std::string& header, const std::vector>& rs); + + std::ostream& print(std::ostream& out); + + private: + + std::vector m_header; + std::vector m_align; + std::vector m_padding; + std::vector> m_table; + }; + + std::ostringstream table_like(const std::vector& data, std::size_t max_width); + } // namespace printers + + // Todo: replace public inheritance with + // private one + using directives + class ConsoleStream : public std::stringstream + { + public: + + ConsoleStream() = default; + ~ConsoleStream(); + }; + + class ProgressBarManager; + class ConsoleData; + + class Console + { + public: + + Console(const Console&) = delete; + Console& operator=(const Console&) = delete; + + Console(Console&&) = delete; + Console& operator=(Console&&) = delete; + + static Console& instance(); + static bool is_available(); + static ConsoleStream stream(); + static bool prompt(std::string_view message, char fallback = '_'); + static bool prompt(std::string_view message, char fallback, std::istream& input_stream); + + ProgressProxy add_progress_bar(const std::string& name, size_t expected_total = 0); + void clear_progress_bars(); + ProgressBarManager& init_progress_bar_manager(ProgressBarMode mode = ProgressBarMode::multi); + void terminate_progress_bar_manager(); + ProgressBarManager& progress_bar_manager(); + + static std::string hide_secrets(std::string_view str); + + void print(std::string_view str, bool force_print = false); + void json_write(const nlohmann::json& j); + void json_append(const std::string& value); + void json_append(const nlohmann::json& j); + void json_down(const std::string& key); + void json_up(); + + static void print_buffer(std::ostream& ostream); + + void cancel_json_print(); + + const Context& context() const; + + Console(const Context& context); + ~Console(); + + private: + + void json_print(); + void deactivate_progress_bar(std::size_t idx, std::string_view msg = ""); + + std::unique_ptr p_data; + + friend class ProgressProxy; + + static void set_singleton(Console& console); + static void clear_singleton(); + }; + + class MessageLogger + { + public: + + MessageLogger(log_level level); + ~MessageLogger(); + + std::stringstream& stream(); + + static void activate_buffer(); + static void deactivate_buffer(); + static void print_buffer(std::ostream& ostream); + + private: + + log_level m_level; + std::stringstream m_stream; + + static void emit(const std::string& msg, const log_level& level); + }; + +} // namespace mamba + +#undef LOG +#undef LOG_TRACE +#undef LOG_DEBUG +#undef LOG_INFO +#undef LOG_WARNING +#undef LOG_ERROR +#undef LOG_CRITICAL + +#define LOG(severity) mamba::MessageLogger(severity).stream() +#define LOG_TRACE LOG(mamba::log_level::trace) +#define LOG_DEBUG LOG(mamba::log_level::debug) +#define LOG_INFO LOG(mamba::log_level::info) +#define LOG_WARNING LOG(mamba::log_level::warn) +#define LOG_ERROR LOG(mamba::log_level::err) +#define LOG_CRITICAL LOG(mamba::log_level::critical) + +#endif // MAMBA_CORE_OUTPUT_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_cache.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_cache.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ba1c7ad7ca3d2324e1d48f3ce38fa7b745d32441 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_cache.hpp @@ -0,0 +1,84 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PACKAGE_CACHE +#define MAMBA_CORE_PACKAGE_CACHE + +#include +#include +#include + +#include "mamba/core/fsutil.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/specs/package_info.hpp" + +#define PACKAGE_CACHE_MAGIC_FILE "urls.txt" + +namespace mamba +{ + struct ValidationParams; + + enum class Writable + { + UNKNOWN, + WRITABLE, + NOT_WRITABLE, + DIR_DOES_NOT_EXIST + }; + + // TODO layered package caches + class PackageCacheData + { + public: + + explicit PackageCacheData(const fs::u8path& path); + + bool create_directory(); + void set_writable(Writable writable); + Writable is_writable(); + fs::u8path path() const; + void clear_query_cache(const specs::PackageInfo& s); + + bool has_valid_tarball(const specs::PackageInfo& s, const ValidationParams& params); + bool has_valid_extracted_dir(const specs::PackageInfo& s, const ValidationParams& params); + + private: + + void check_writable(); + + std::map m_valid_tarballs; + std::map m_valid_extracted_dir; + Writable m_writable = Writable::UNKNOWN; + fs::u8path m_path; + }; + + class MultiPackageCache + { + public: + + MultiPackageCache(const std::vector& pkgs_dirs, const ValidationParams& params); + + std::vector paths() const; + + fs::u8path get_tarball_path(const specs::PackageInfo& s, bool return_empty = true); + fs::u8path get_extracted_dir_path(const specs::PackageInfo& s, bool return_empty = true); + + fs::u8path first_writable_path(); + PackageCacheData& first_writable_cache(bool create = false); + std::vector writable_caches(); + + void clear_query_cache(const specs::PackageInfo& s); + + private: + + std::vector m_caches; + std::map m_cached_tarballs; + std::map m_cached_extracted_dirs; + const ValidationParams& m_params; + }; +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_database_loader.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_database_loader.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d1df00ecdb587ab266668daf0ca0b91c739c3748 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_database_loader.hpp @@ -0,0 +1,39 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP +#define MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP + +#include "mamba/core/error_handling.hpp" +#include "mamba/solver/libsolv/repo_info.hpp" +#include "mamba/specs/channel.hpp" + +namespace mamba +{ + class Context; + class PrefixData; + class SubdirIndexLoader; + + namespace solver::libsolv + { + class Database; + } + + void add_spdlog_logger_to_database(solver::libsolv::Database& database); + + auto load_subdir_in_database( // + const Context& ctx, + solver::libsolv::Database& database, + const SubdirIndexLoader& subdir + ) -> expected_t; + + auto load_installed_packages_in_database( + const Context& ctx, + solver::libsolv::Database& database, + const PrefixData& prefix + ) -> solver::libsolv::RepoInfo; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_fetcher.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_fetcher.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5e9974b1814dbcb53c72ddf2a5f8c67a24fa5964 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_fetcher.hpp @@ -0,0 +1,147 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PACKAGE_FETCHER_HPP +#define MAMBA_CORE_PACKAGE_FETCHER_HPP + +#include + +#include "mamba/core/package_cache.hpp" +#include "mamba/core/package_handling.hpp" +#include "mamba/core/thread_utils.hpp" +#include "mamba/download/downloader.hpp" +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + + class PackageFetcher; + + enum class PackageExtractEvent + { + validate_update, + validate_success, + validate_failure, + extract_update, + extract_success, + extract_failure + }; + + class PackageExtractTask + { + public: + + struct Result + { + bool valid; + bool extracted; + }; + + using progress_callback_t = std::function; + + PackageExtractTask(PackageFetcher* fetcher, ExtractOptions options); + + const std::string& name() const; + bool needs_download() const; + + void set_progress_callback(progress_callback_t cb); + + Result run(); + Result run(std::size_t downloaded_size); + + private: + + progress_callback_t* get_progress_callback(); + + PackageFetcher* p_fetcher; + ExtractOptions m_options; + std::optional m_progress_callback = std::nullopt; + }; + + class PackageFetcher + { + public: + + enum class ValidationResult + { + UNDEFINED = 0, + VALID = 1, + SHA256_ERROR, + MD5SUM_ERROR, + SIZE_ERROR, + EXTRACT_ERROR + }; + + using post_download_success_t = std::function; + using progress_callback_t = std::function; + + PackageFetcher(const specs::PackageInfo& pkg_info, MultiPackageCache& caches); + + const std::string& name() const; + + bool needs_download() const; + bool needs_extract() const; + + download::Request + build_download_request(std::optional callback = std::nullopt); + ValidationResult + validate(std::size_t downloaded_size, progress_callback_t* cb = nullptr) const; + bool extract(const ExtractOptions& options, progress_callback_t* cb = nullptr); + + // The PackageFetcher object should be stable in memory (i.e. not moved) after this + // method has been called, until the PackageExtractTask has been completed. + PackageExtractTask build_extract_task(ExtractOptions options); + + void clear_cache() const; + + private: + + struct CheckSumParams; + + bool use_oci() const; + bool use_auth() const; + const std::string& filename() const; + std::string channel() const; + std::string url_path() const; + const std::string& url() const; + const std::string& sha256() const; + const std::string& md5() const; + std::size_t expected_size() const; + + ValidationResult validate_size(std::size_t downloaded_size) const; + ValidationResult validate_checksum(const CheckSumParams& params) const; + + void write_repodata_record(const fs::u8path& base_path) const; + void update_urls_txt() const; + + void update_monitor(progress_callback_t* cb, PackageExtractEvent event) const; + + specs::PackageInfo m_package_info; + + fs::u8path m_tarball_path; + fs::u8path m_cache_path; + + bool m_needs_download = false; + std::string m_downloaded_url = {}; + bool m_needs_extract = false; + }; + + class PackageFetcherSemaphore + { + public: + + static std::ptrdiff_t get_max(); + static void set_max(int value); + + private: + + static counting_semaphore semaphore; + + friend class PackageFetcher; + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_handling.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_handling.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b1522d413c67f629b4497e519c4ae5a2d7a5c294 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_handling.hpp @@ -0,0 +1,88 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PACKAGE_HANDLING_HPP +#define MAMBA_CORE_PACKAGE_HANDLING_HPP + +#include +#include +#include + +#include "mamba/fs/filesystem.hpp" + +namespace mamba +{ + struct ValidationParams; + class Context; + + // Determine the kind of command line to run to extract subprocesses. + enum class extract_subproc_mode + { + /** An external binary packaged with `libmamba` to launch as a subprocess. */ + mamba_package, + /** The mamba or micromamba executable calling itself. */ + mamba_exe, + }; + + struct ExtractOptions + { + bool sparse = false; + extract_subproc_mode subproc_mode; + static ExtractOptions from_context(const Context&); + }; + + enum compression_algorithm + { + none, + bzip2, + zip, + zstd + }; + + void create_archive( + const fs::u8path& directory, + const fs::u8path& destination, + compression_algorithm, + int compression_level, + int compression_threads, + bool (*filter)(const fs::u8path&) + ); + void create_package( + const fs::u8path& directory, + const fs::u8path& out_file, + int compression_threads, + int compression_level + ); + + void + extract_archive(const fs::u8path& file, const fs::u8path& destination, const ExtractOptions& options); + void extract_conda( + const fs::u8path& file, + const fs::u8path& dest_dir, + const ExtractOptions& options, + const std::vector& parts = { "info", "pkg" } + ); + void + extract(const fs::u8path& file, const fs::u8path& destination, const ExtractOptions& options); + fs::u8path extract(const fs::u8path& file, const ExtractOptions& options); + + + void + extract_subproc(const fs::u8path& file, const fs::u8path& dest, const ExtractOptions& options); + + bool transmute( + const fs::u8path& pkg_file, + const fs::u8path& target, + int compression_level, + int compression_threads, + const ExtractOptions& options + ); + + bool validate(const fs::u8path& pkg_folder, const ValidationParams& params); + +} // namespace mamba + +#endif // MAMBA_PACKAGE_HANDLING_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_paths.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_paths.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ceb247949a0d46aa4472aa4eae9f59e973db576d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/package_paths.hpp @@ -0,0 +1,70 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_READ_PATHS_HPP +#define MAMBA_CORE_READ_PATHS_HPP + +#include +#include +#include +#include + +#include "util.hpp" + +const char PREFIX_PLACEHOLDER_1[] = "/opt/anaconda1anaconda2"; +// this is intentionally split into parts, such that running +// this program on itself will leave it unchanged +const char PREFIX_PLACEHOLDER_2[] = "anaconda3"; + +namespace mamba +{ + struct PrefixFileParse + { + std::string placeholder; + std::string file_mode; + std::string file_path; + }; + + enum class PathType + { + UNDEFINED, + HARDLINK, + SOFTLINK, + DIRECTORY, + + // These should not occur in a package, only after installation + LINKED_PACKAGE_RECORD, + PYC_FILE, + UNIX_PYTHON_ENTRY_POINT, + WINDOWS_PYTHON_ENTRY_POINT_SCRIPT, + WINDOWS_PYTHON_ENTRY_POINT_EXE + }; + + enum class FileMode + { + UNDEFINED, + BINARY, + TEXT + }; + + struct PathData + { + std::string path; + PathType path_type = PathType::UNDEFINED; + std::string sha256; + std::size_t size_in_bytes = 0; + + std::string prefix_placeholder; + FileMode file_mode = FileMode::TEXT; + bool no_link = false; + }; + + std::map read_has_prefix(const fs::u8path& path); + std::set read_no_link(const fs::u8path& info_dir); + std::vector read_paths(const fs::u8path& directory); +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/palette.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/palette.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1eec8c2f13258b95d95ca4d962598b11936e7431 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/palette.hpp @@ -0,0 +1,80 @@ +// Copyright (c) 2022, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PALETTE_HPP +#define MAMBA_CORE_PALETTE_HPP + +#include + +namespace mamba +{ + struct Palette + { + /** Something that is possible or exists. */ + fmt::text_style success; + /** Something that is impossible or does not exist. */ + fmt::text_style failure; + /** Refers to external ecosystem. */ + fmt::text_style external; + /** Information that was already shown (for. */ + fmt::text_style shown; + /** Some action is safe or trusted. */ + fmt::text_style safe; + /** Some action is unsafe or not trusted. */ + fmt::text_style unsafe; + + /** Reference to some input from the user. */ + fmt::text_style user; + /** Input from the user was ignored or has no effect. */ + fmt::text_style ignored; + /** Something was added due to user input. */ + fmt::text_style addition; + /** Something was removed due to user input. */ + fmt::text_style deletion; + + /** The color of an empty progress bar. */ + fmt::text_style progress_bar_none; + /** The color of the downloaded items in the progress bar. */ + fmt::text_style progress_bar_downloaded; + /** The color of the extracted items in the progress bar. */ + fmt::text_style progress_bar_extracted; + + /** A Palette with no colors at all. */ + static constexpr auto no_color() -> Palette; + /** A Palette with terminal 4 bit colors. */ + static constexpr auto terminal() -> Palette; + }; + + /******************************* + * Implementation of Palette * + *******************************/ + + inline constexpr auto Palette::no_color() -> Palette + { + return {}; + } + + inline constexpr auto Palette::terminal() -> Palette + { + return { + /* .success= */ fmt::fg(fmt::terminal_color::green), + /* .failure= */ fmt::fg(fmt::terminal_color::red), + /* .external= */ fmt::fg(fmt::terminal_color::cyan), + /* .shown= */ fmt::fg(fmt::terminal_color::bright_black), + /* .safe= */ fmt::fg(fmt::terminal_color::green), + /* .unsafe= */ fmt::fg(fmt::terminal_color::red), + /* .user= */ fmt::fg(fmt::terminal_color::blue) | fmt::emphasis::bold, + /* .ignored= */ fmt::fg(fmt::terminal_color::yellow), + /* .addition= */ fmt::fg(fmt::terminal_color::green), + /* .deletion= */ fmt::fg(fmt::terminal_color::red), + /* .progress_bar_none= */ fmt::fg(fmt::terminal_color::bright_black), + /* .progress_bar_downloaded= */ fmt::fg(fmt::terminal_color::yellow), + /* .progress_bar_extracted= */ {}, + }; + } + +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/pinning.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/pinning.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9c121f30eb2a9cd98feab0bf0de12e32614b5b4d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/pinning.hpp @@ -0,0 +1,29 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PINNING_HPP +#define MAMBA_CORE_PINNING_HPP + +#include +#include + +namespace mamba +{ + class Context; + class ChannelContext; + class PrefixData; + + namespace fs + { + class u8path; + } + + std::string python_pin(PrefixData& prefix_data, const std::vector& specs); + + std::vector file_pins(const fs::u8path& file); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/prefix_data.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/prefix_data.hpp new file mode 100644 index 0000000000000000000000000000000000000000..15e796de4c9a4105b868c2c53ce8871b95a019d2 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/prefix_data.hpp @@ -0,0 +1,61 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PREFIX_DATA_HPP +#define MAMBA_CORE_PREFIX_DATA_HPP + +#include +#include + +#include "mamba/core/error_handling.hpp" +#include "mamba/core/history.hpp" +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + class ChannelContext; + + class PrefixData + { + public: + + using package_map = std::map; + + static expected_t + create(const fs::u8path& prefix_path, ChannelContext& channel_context, bool no_pip = false); + + void add_packages(const std::vector& packages); + void load_single_record(const fs::u8path& path); + + const package_map& records() const; + const package_map& pip_records() const; + package_map all_pkg_mgr_records() const; + + History& history(); + const fs::u8path& path() const; + std::vector sorted_records() const; + + ChannelContext& channel_context() const + { + return m_channel_context; + } + + private: + + PrefixData(const fs::u8path& prefix_path, ChannelContext& channel_context, bool no_pip); + + void load_site_packages(); + + History m_history; + package_map m_package_records; + package_map m_pip_package_records; + fs::u8path m_prefix_path; + + ChannelContext& m_channel_context; + }; +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/progress_bar.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/progress_bar.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c32524a8fe567a25157e39d1afc528958b79882c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/progress_bar.hpp @@ -0,0 +1,100 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PROGRESS_BAR_HPP +#define MAMBA_CORE_PROGRESS_BAR_HPP + +#include +#include +#include +#include + +namespace mamba +{ + class ProgressBar; + struct ProgressBarOptions; + // TODO: find a way to define it here without + // impoorting spdlog and modst of the STL. + class ProgressBarRepr; + + enum ProgressBarMode + { + multi, + aggregated + }; + + class ProgressProxy + { + public: + + ProgressProxy() = default; + ProgressProxy(ProgressBar* ptr); + ~ProgressProxy() = default; + + ProgressProxy(const ProgressProxy&) = default; + ProgressProxy& operator=(const ProgressProxy&) = default; + ProgressProxy(ProgressProxy&&) = default; + ProgressProxy& operator=(ProgressProxy&&) = default; + + bool defined() const; + operator bool() const; + ProgressProxy& set_bar(ProgressBar* ptr); + + ProgressProxy& set_progress(std::size_t current, std::size_t total); + ProgressProxy& update_progress(std::size_t current, std::size_t total); + ProgressProxy& set_progress(double progress); + ProgressProxy& set_current(std::size_t current); + ProgressProxy& set_in_progress(std::size_t in_progress); + ProgressProxy& update_current(std::size_t current); + ProgressProxy& set_total(std::size_t total); + ProgressProxy& set_speed(std::size_t speed); + ProgressProxy& set_full(); + ProgressProxy& activate_spinner(); + ProgressProxy& deactivate_spinner(); + + std::size_t current() const; + std::size_t in_progress() const; + std::size_t total() const; + std::size_t speed() const; + std::size_t + avg_speed(const std::chrono::milliseconds& ref_duration = std::chrono::milliseconds::max()); + double progress() const; + bool completed() const; + + ProgressProxy& set_prefix(const std::string& text); + ProgressProxy& set_postfix(const std::string& text); + ProgressProxy& set_repr_hook(std::function f); + ProgressProxy& set_progress_hook(std::function f); + ProgressProxy& + mark_as_completed(const std::chrono::milliseconds& delay = std::chrono::milliseconds::zero()); + + std::string elapsed_time_to_str() const; + std::string prefix() const; + + ProgressBarRepr& update_repr(bool compute_progress = true); + const ProgressBarRepr& repr() const; + ProgressBarRepr& repr(); + ProgressProxy& print(std::ostream& stream, std::size_t width = 0, bool with_endl = true); + + ProgressProxy& start(); + ProgressProxy& pause(); + ProgressProxy& resume(); + ProgressProxy& stop(); + + bool started() const; + + int width() const; + const ProgressBarOptions& options() const; + + private: + + ProgressBar* p_bar = nullptr; + + friend class ProgressBarManager; + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/query.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/query.hpp new file mode 100644 index 0000000000000000000000000000000000000000..171b0432863383cf202085441ccb44056085512d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/query.hpp @@ -0,0 +1,125 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_QUERY_HPP +#define MAMBA_CORE_QUERY_HPP + +#include +#include +#include +#include +#include + +#include "mamba/core/context.hpp" +#include "mamba/specs/package_info.hpp" +#include "mamba/util/graph.hpp" + +namespace mamba +{ + namespace solver::libsolv + { + class Database; + } + + enum class QueryType + { + Search, + Depends, + WhoNeeds + }; + + constexpr auto enum_name(QueryType t) -> std::string_view; + + auto query_type_parse(std::string_view name) -> QueryType; + + class QueryResult + { + public: + + using GraphicsParams = Context::GraphicsParams; + using dependency_graph = util::DiGraph; + + QueryResult(QueryType type, std::string query, dependency_graph dep_graph); + QueryResult(const QueryResult&) = default; + QueryResult(QueryResult&&) = default; + + ~QueryResult() = default; + + auto operator=(const QueryResult&) -> QueryResult& = default; + auto operator=(QueryResult&&) -> QueryResult& = default; + + [[nodiscard]] auto type() const -> QueryType; + [[nodiscard]] auto query() const -> const std::string&; + [[nodiscard]] auto empty() const -> bool; + + auto sort(std::string_view field) -> QueryResult&; + + auto groupby(std::string_view field) -> QueryResult&; + + auto reset() -> QueryResult&; + + auto table(std::ostream&) const -> std::ostream&; + auto table(std::ostream&, const std::vector& fmt) const -> std::ostream&; + [[nodiscard]] auto table_to_str() const -> std::string; + + auto tree(std::ostream&, const GraphicsParams& graphics) const -> std::ostream&; + [[nodiscard]] auto tree_to_str(const GraphicsParams& graphics) const -> std::string; + + [[nodiscard]] auto json() const -> nlohmann::json; + + auto pretty(std::ostream&, bool show_all_builds) const -> std::ostream&; + [[nodiscard]] auto pretty_to_str(bool show_all_builds) const -> std::string; + + private: + + using node_id = dependency_graph::node_id; + using package_id_list = std::vector; + using ordered_package_list = std::map; + + void reset_pkg_view_list(); + + QueryType m_type; + std::string m_query; + dependency_graph m_dep_graph; + package_id_list m_pkg_id_list = {}; + ordered_package_list m_ordered_pkg_id_list = {}; + }; + + class Query + { + public: + + using Database = solver::libsolv::Database; + + [[nodiscard]] static auto find(Database& database, const std::vector& queries) + -> QueryResult; + + [[nodiscard]] static auto whoneeds(Database& database, std::string query, bool tree) + -> QueryResult; + + [[nodiscard]] static auto depends(Database& database, std::string query, bool tree) + -> QueryResult; + }; + + /******************** + * Implementation * + ********************/ + + constexpr auto enum_name(QueryType t) -> std::string_view + { + switch (t) + { + case QueryType::Search: + return "Search"; + case QueryType::WhoNeeds: + return "WhoNeeds"; + case QueryType::Depends: + return "Depends"; + } + throw std::invalid_argument("Invalid enum value"); + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/repo_checker_store.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/repo_checker_store.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6fe603e305a11d95cd46842a955b3921d7816e38 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/repo_checker_store.hpp @@ -0,0 +1,46 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_REPO_CHECKER_STORE_HPP +#define MAMBA_CORE_REPO_CHECKER_STORE_HPP + +#include +#include + +#include "mamba/specs/channel.hpp" +#include "mamba/validation/repo_checker.hpp" + +namespace mamba +{ + class Context; + class ChannelContext; + class MultiPackageCache; + + class RepoCheckerStore + { + public: + + using Channel = specs::Channel; + using RepoChecker = validation::RepoChecker; + using repo_checker_list = std::vector>; + + [[nodiscard]] static auto + make(const Context& ctx, ChannelContext& cc, MultiPackageCache& caches) -> RepoCheckerStore; + + explicit RepoCheckerStore(repo_checker_list checkers); + + [[nodiscard]] auto find_checker(const Channel& chan) -> RepoChecker*; + + [[nodiscard]] auto contains_checker(const Channel& chan) -> bool; + + [[nodiscard]] auto at_checker(const Channel& chan) -> RepoChecker&; + + private: + + repo_checker_list m_repo_checkers = {}; + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/run.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/run.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1af3c1fc2124dd0928358d4c4ebffe0c91e2361e --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/run.hpp @@ -0,0 +1,66 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#include +#include + +#include + +#include "mamba/core/util.hpp" +#include "mamba/fs/filesystem.hpp" + +namespace mamba +{ + class Context; + + bool is_process_name_running(const std::string& name); + std::string generate_unique_process_name(std::string_view program_name); + const fs::u8path& proc_dir(); + LockFile lock_proc_dir(); + + void daemonize(); + + class ScopedProcFile + { + const fs::u8path location; + + public: + + ScopedProcFile( + const Context& context, + const std::string& name, + const std::vector& command, + LockFile proc_dir_lock = lock_proc_dir() + ); + ~ScopedProcFile(); + }; + + enum class STREAM_OPTIONS : int + { + ALL_STREAMS = 0, + SINKOUT = 1, + SINKERR = 1 << 1, + SINKIN = 1 << 2, + }; + + int run_in_environment( + const Context& context, + const fs::u8path& prefix, + std::vector command, + const std::string& cwd, + int stream_options, + bool clean_env, + bool detach, + const std::vector& env_vars, + const std::string& specific_process_name + ); + + nlohmann::json get_all_running_processes_info( + const std::function& filter = std::function< + bool(const nlohmann::json&)>() + ); + bool is_process_name_running(const std::string& name); +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/shell_init.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/shell_init.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f8b15b7fccd23e2444c8b86410ed9d096db09630 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/shell_init.hpp @@ -0,0 +1,90 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_SHELL_INIT +#define MAMBA_CORE_SHELL_INIT + +#include +#include +#include + +#include "mamba/fs/filesystem.hpp" + +extern const char data_mamba_sh[]; +extern const char data_mamba_csh[]; +extern const char data_mamba_bat[]; +extern const char data_activate_bat[]; +extern const char data__mamba_activate_bat[]; +extern const char data_mamba_hook_bat[]; +extern const char data_mamba_hook_ps1[]; +extern const char data_Mamba_psm1[]; +extern const char data_mamba_xsh[]; +extern const char data_mamba_fish[]; +extern const char data_mamba_completion_posix[]; + +namespace mamba +{ + class Context; + + std::string guess_shell(); + +#ifdef _WIN32 + void init_cmd_exe_registry( + const Context& context, + const std::wstring& reg_path, + const fs::u8path& conda_prefix + ); +#endif + + std::string get_hook_contents(const Context& context, const std::string& shell); + + // this function calls cygpath to convert win path to unix + std::string native_path_to_unix(const std::string& path, bool is_a_path_env = false); + + std::string + rcfile_content(const fs::u8path& env_prefix, std::string_view shell, const fs::u8path& mamba_exe); + + std::string + xonsh_content(const fs::u8path& env_prefix, const std::string& shell, const fs::u8path& mamba_exe); + + void modify_rc_file( + const Context& context, + const fs::u8path& file_path, + const fs::u8path& conda_prefix, + const std::string& shell, + const fs::u8path& mamba_exe + ); + + void reset_rc_file( + const Context& context, + const fs::u8path& file_path, + const std::string& shell, + const fs::u8path& mamba_exe + ); + + // we need this function during linking... + void init_root_prefix_cmdexe(const fs::u8path& root_prefix); + void deinit_root_prefix_cmdexe(const Context& context, const fs::u8path& root_prefix); + void init_root_prefix(Context& context, const std::string& shell, const fs::u8path& root_prefix); + void + deinit_root_prefix(Context& context, const std::string& shell, const fs::u8path& root_prefix); + + std::string powershell_contents(const fs::u8path& conda_prefix); + void + init_powershell(const Context& context, const fs::u8path& profile_path, const fs::u8path& conda_prefix); + void deinit_powershell( + const Context& context, + const fs::u8path& profile_path, + const fs::u8path& conda_prefix + ); + + void init_shell(Context& context, const std::string& shell, const fs::u8path& conda_prefix); + void deinit_shell(Context& context, const std::string& shell, const fs::u8path& conda_prefix); + std::vector find_initialized_shells(); + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_index.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_index.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4bf9f54a9c0dbf0e4d5d81aaf82babe19a933c13 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_index.hpp @@ -0,0 +1,418 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_SUBDIRDATA_HPP +#define MAMBA_CORE_SUBDIRDATA_HPP + +#include +#include +#include +#include + +#include + +#include "mamba/core/error_handling.hpp" +#include "mamba/core/package_cache.hpp" +#include "mamba/core/subdir_parameters.hpp" +#include "mamba/download/downloader.hpp" +#include "mamba/download/parameters.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/specs/channel.hpp" +#include "mamba/specs/conda_url.hpp" +#include "mamba/specs/platform.hpp" + +namespace mamba +{ + namespace specs + { + class Channel; + } + + /** + * Handling of a subdirectory metadata. + * + * These metadata are used and stored to check if a subdirectory index is up to date, + * where it comes from, and what protocols are supported to fetch it. + */ + class SubdirMetadata + { + public: + + struct HttpMetadata + { + std::string url; + std::string etag; + std::string last_modified; + std::string cache_control; + }; + + using expected_subdir_metadata = tl::expected; + + /** Read the metadata from a lightweight file containing only these metadata. */ + static auto read_state_file( // + const fs::u8path& state_file, + const fs::u8path& repodata_file + ) -> expected_subdir_metadata; + + /** Read the metadata from the ``repodata.json`` header. */ + static auto read_from_repodata_json(const fs::u8path& json) -> expected_subdir_metadata; + + /** Read from any of state file or ``repodata.json`` depending on extension. */ + static auto read(const fs::u8path& file) -> expected_subdir_metadata; + + [[nodiscard]] auto is_valid_metadata(const fs::u8path& file) const -> bool; + [[nodiscard]] auto url() const -> const std::string&; + [[nodiscard]] auto etag() const -> const std::string&; + [[nodiscard]] auto last_modified() const -> const std::string&; + [[nodiscard]] auto cache_control() const -> const std::string&; + + /** Check if zst is available and freshly checked. */ + [[nodiscard]] auto has_up_to_date_zst() const -> bool; + + void set_http_metadata(HttpMetadata data); + void set_zst(bool value); + void store_file_metadata(const fs::u8path& file); + + /** Write the metadata to a lightweight file. */ + void write_state_file(const fs::u8path& file); + + friend void to_json(nlohmann::json& j, const SubdirMetadata& data); + friend void from_json(const nlohmann::json& j, SubdirMetadata& data); + + private: + +#ifdef _WIN32 + using time_type = std::chrono::system_clock::time_point; +#else + using time_type = fs::file_time_type; +#endif + + struct CheckedAt + { + bool value; + std::time_t last_checked; + + bool has_expired() const; + }; + + HttpMetadata m_http; + std::optional m_has_zst; + time_type m_stored_mtime; + std::size_t m_stored_file_size; + + friend void to_json(nlohmann::json& j, const CheckedAt& ca); + friend void from_json(const nlohmann::json& j, CheckedAt& ca); + }; + + /** + * Channel sub-directory (i.e. a platform) packages index. + * + * Handles downloading of the index from the server and cache generation. + * This only handles traditional ``repodata.json`` full indexes. + * This abstraction does not load the index in memory, with is done by the @ref Database. + * + * Upon creation, the caches are checked for a valid and up to date index. + * This can be inspected with @ref valid_cache_found. + * The created subdirs are typically used with @ref SubdirIndexLoader::download_required_indexes + * which will download the missing, invalid, or outdated indexes as needed. + */ + class SubdirIndexLoader + { + public: + + /** + * Download the missing, invalid, or outdated indexes as needed in parallel. + * + * It first creates check requests to update some metadata, then download the indexes. + * The result can be inspected with the input subdirs methods, such as + * @ref valid_cache_found, @ref valid_json_cache_path etc. + */ + template + [[nodiscard]] static auto download_required_indexes( + SubdirIter1 subdirs_first, + SubdirIter2 subdirs_last, + const SubdirDownloadParams& subdir_params, + const specs::AuthenticationDataBase& auth_info, + const download::mirror_map& mirrors, + const download::Options& download_options, + const download::RemoteFetchParams& remote_fetch_params, + download::Monitor* check_monitor = nullptr, + download::Monitor* download_monitor = nullptr + ) -> expected_t; + template + [[nodiscard]] static auto download_required_indexes( + Subdirs& subdirs, + const SubdirDownloadParams& subdir_params, + const specs::AuthenticationDataBase& auth_info, + const download::mirror_map& mirrors, + const download::Options& download_options, + const download::RemoteFetchParams& remote_fetch_params, + download::Monitor* check_monitor = nullptr, + download::Monitor* download_monitor = nullptr + ) -> expected_t; + + /** Check existing caches for a valid index validity and freshness. */ + static auto create( + const SubdirParams& params, + specs::Channel channel, + specs::DynamicPlatform platform, + MultiPackageCache& caches, + std::string repodata_filename = "repodata.json" + ) -> expected_t; + + [[nodiscard]] auto is_noarch() const -> bool; + [[nodiscard]] auto is_local() const -> bool; + [[nodiscard]] auto channel() const -> const specs::Channel&; + [[nodiscard]] auto name() const -> std::string; + [[nodiscard]] auto channel_id() const -> const std::string&; + [[nodiscard]] auto platform() const -> const specs::DynamicPlatform&; + [[nodiscard]] auto metadata() const -> const SubdirMetadata&; + [[nodiscard]] auto repodata_url() const -> specs::CondaURL; + + [[nodiscard]] auto caching_is_forbidden() const -> bool; + [[nodiscard]] auto valid_cache_found() const -> bool; + [[nodiscard]] auto valid_libsolv_cache_path() const -> expected_t; + [[nodiscard]] auto writable_libsolv_cache_path() const -> fs::u8path; + [[nodiscard]] auto valid_json_cache_path() const -> expected_t; + + void clear_valid_cache_files(); + + private: + + // This paths are pointing to what is found when iterating over the cache directories. + // The expired found is the first one, which could be improved by keeping the freshest one. + // This could improve caching in some HTTP 304 cases. + // A possible improvement would be to keep all path, metadatas, and writable status in a + // single vector and sort them by recency. + // This would also give a public option for `clear`-ing all writable caches, not just the + // valid one. + SubdirMetadata m_metadata; + specs::Channel m_channel; + fs::u8path m_valid_cache_path; + std::optional m_expired_cache_path; + fs::u8path m_writable_pkgs_dir; + specs::DynamicPlatform m_platform; + std::string m_repodata_filename; + std::string m_json_filename; + std::string m_solv_filename; + bool m_valid_cache_found = false; + bool m_json_cache_valid = false; + bool m_solv_cache_valid = false; + + SubdirIndexLoader( + const SubdirParams& params, + specs::Channel channel, + std::string platform, + MultiPackageCache& caches, + std::string repodata_fn = "repodata.json" + ); + + [[nodiscard]] auto repodata_url_path() const -> std::string; + [[nodiscard]] auto valid_json_cache_path_unchecked() const -> fs::u8path; + [[nodiscard]] auto valid_state_file_path_unchecked() const -> fs::u8path; + [[nodiscard]] auto valid_libsolv_cache_path_unchecked() const -> fs::u8path; + + /********************************************************* + * Implementation details of SubdirIndexLoader::create * + *********************************************************/ + + void load(const MultiPackageCache& caches, const SubdirParams& params); + void load_cache(const MultiPackageCache& caches, const SubdirParams& params); + + /**************************************************************************** + * Implementation details of SubdirIndexLoader::download_required_indexes * + ****************************************************************************/ + + auto use_existing_cache() -> expected_t; + auto finalize_transfer(SubdirMetadata::HttpMetadata http_data, const fs::u8path& artifact) + -> expected_t; + void refresh_last_write_time(const fs::u8path& json_file, const fs::u8path& solv_file); + + template + static auto + build_all_check_requests(First subdirs_first, End subdirs_last, const SubdirDownloadParams& params) + -> download::MultiRequest; + auto build_check_requests(const SubdirDownloadParams& params) -> download::MultiRequest; + + template + static auto + build_all_index_requests(First subdirs_first, End subdirs_last, const SubdirDownloadParams& params) + -> download::MultiRequest; + auto build_index_request(const SubdirDownloadParams& params) + -> std::optional; + + [[nodiscard]] static auto download_requests( + download::MultiRequest index_requests, + const specs::AuthenticationDataBase& auth_info, + const download::mirror_map& mirrors, + const download::Options& download_options, + const download::RemoteFetchParams& remote_fetch_params, + download::Monitor* download_monitor + ) -> expected_t; + }; + + /** + * Compute an id from a URL. + * + * This is intended to keep unique, filesystem-safe, cache entries in the cache directory. + * @see cache_filename_from_url + */ + [[nodiscard]] auto cache_name_from_url(std::string url) -> std::string; + + /** + * Compute a filename from a URL. + * + * This is intended to keep unique, filesystem-safe, cache entries in the cache directory. + * Contrary to conda original function, this one expects a full url (that is + * channel url + / + repodata_fn). + * It is not the responsibility of this function to decide whether it should concatenate base + * url and repodata depending on repodata value and old behavior support. + */ + [[nodiscard]] auto cache_filename_from_url(std::string url) -> std::string; + + /** + * Create cache directory with correct permissions + * + * @return The path to the directory created + */ + auto create_cache_dir(const fs::u8path& cache_path) -> std::string; + + /***************************************** + * Implementation of SubdirIndexLoader * + *****************************************/ + + template + auto SubdirIndexLoader::download_required_indexes( + SubdirIter1 subdirs_first, + SubdirIter2 subdirs_last, + const SubdirDownloadParams& subdir_params, + const specs::AuthenticationDataBase& auth_info, + const download::mirror_map& mirrors, + const download::Options& download_options, + const download::RemoteFetchParams& remote_fetch_params, + download::Monitor* check_monitor, + download::Monitor* download_monitor + ) -> expected_t + { + auto result = download_requests( + build_all_check_requests(subdirs_first, subdirs_last, subdir_params), + auth_info, + mirrors, + download_options, + remote_fetch_params, + check_monitor + ); + + // Allow to continue if failed checks, unless asked to stop. + constexpr auto is_interrupted = [](const auto& e) + { return e.error_code() == mamba_error_code::user_interrupted; }; + + if (!result.has_value() && result.map_error(is_interrupted).error()) + { + return result; + } + + return download_requests( + build_all_index_requests(subdirs_first, subdirs_last, subdir_params), + auth_info, + mirrors, + download_options, + remote_fetch_params, + download_monitor + ); + } + + template + auto SubdirIndexLoader::download_required_indexes( + Subdirs& subdirs, + const SubdirDownloadParams& subdir_params, + const specs::AuthenticationDataBase& auth_info, + const download::mirror_map& mirrors, + const download::Options& download_options, + const download::RemoteFetchParams& remote_fetch_params, + download::Monitor* check_monitor, + download::Monitor* download_monitor + ) -> expected_t + { + return download_required_indexes( + subdirs.begin(), + subdirs.end(), + subdir_params, + auth_info, + mirrors, + download_options, + remote_fetch_params, + check_monitor, + download_monitor + ); + } + + template + auto SubdirIndexLoader::build_all_check_requests( + First subdirs_first, + End subdirs_last, + const SubdirDownloadParams& params + ) -> download::MultiRequest + { + download::MultiRequest requests; + for (; subdirs_first != subdirs_last; ++subdirs_first) + { + // TODO(C++23): We make a special handling of iterators of pointers due to the + // difficulty and necessity to create a range of references from Python objects. + SubdirIndexLoader* p_subdir = nullptr; + if constexpr (std::is_pointer_v>) + { + p_subdir = *subdirs_first; + } + else + { + p_subdir = &(*subdirs_first); + } + + if (p_subdir != nullptr && !p_subdir->valid_cache_found()) + { + auto check_list = p_subdir->build_check_requests(params); + std::move(check_list.begin(), check_list.end(), std::back_inserter(requests)); + } + } + return requests; + } + + template + auto SubdirIndexLoader::build_all_index_requests( + First subdirs_first, + End subdirs_last, + const SubdirDownloadParams& params + ) -> download::MultiRequest + { + download::MultiRequest requests; + for (; subdirs_first != subdirs_last; ++subdirs_first) + { + // TODO(C++23): We make a special handling of iterators of pointers due to the + // difficulty and necessity to create a range of references from Python objects. + SubdirIndexLoader* p_subdir = nullptr; + if constexpr (std::is_pointer_v>) + { + p_subdir = *subdirs_first; + } + else + { + p_subdir = &(*subdirs_first); + } + + if (!p_subdir->valid_cache_found()) + { + if (auto request = p_subdir->build_index_request(params)) + { + requests.push_back(*std::move(request)); + } + } + } + return requests; + } + +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_parameters.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_parameters.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f2ccb2972090e4117edd7b7301d4f9350c05eb3a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/subdir_parameters.hpp @@ -0,0 +1,35 @@ +// Copyright (c) 2025, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_SUBDIR_PARAMETERS_HPP +#define MAMBA_CORE_SUBDIR_PARAMETERS_HPP + +#include + +namespace mamba +{ + struct SubdirParams + { + /** + * Repodata cache time to live in seconds. + * + * If not specified, then it is read from server headers. + */ + std::optional local_repodata_ttl_s = std::nullopt; + bool offline = false; + /** Force the use of zst for this subdir without checking. */ + bool repodata_force_use_zst = false; + }; + + struct SubdirDownloadParams + { + bool offline = false; + /** Make a request to check the use of zst compression format. */ + bool repodata_check_zst = true; + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/tasksync.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/tasksync.hpp new file mode 100644 index 0000000000000000000000000000000000000000..dcb5224a64f07d52b258baed73623a074529bbc1 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/tasksync.hpp @@ -0,0 +1,225 @@ +// Copyright (c) 2022, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "mamba/core/util_scope.hpp" + +namespace mamba +{ + + // WARNING: this file will be moved to xtl as soon as possible, do not rely on it's existence + // here! + + /** Synchronize tasks execution in multiple threads with this object's lifetime. + + A synchronized callable will never execute outside the lifetime of this object. + To achieve this, the callable must be wrapped into a callable with the same + features that will guarantee that + - if this object have been destroyed and then the synchronized callable is invoked, + the callable will not execute it's code; + - if this object is being joined and/or destroyed, it will block until any already started + tasks are ended; + + WARNING: When used as a member of a type to synchronized tasks of the `this` instance, it is + best to set the TaskSynchronizer as the last member so that it is the first one to be + destroyed; alternatively, `.join_tasks()` can be called manually in the destructor too. + + Example: + + class MonSystem + { + public: + + // Whatever "scheduler" or "other_sys" is.... + MonSystem(Scheduler scheduler, OtherSystem other_sys) : scheduler(sccheduler) + { + // This callback will do nothing if this object is destroyed. + other_sys.on_something(synchronized.synchronized([this]{ ok(); })); + } + + void ok(); + + void launch_work() + { + // This task will do nothing if this object is destroyed. + scheduler.push(task_sync.synchronized([this]{ + ... + })); + } + + private: + + Scheduler scheduler; + BigData data; + + task_synchronizer task_sync; // When this object is destroyed, join tasks. + }; + + */ + class TaskSynchronizer + { + auto make_remote_status() + { + return std::weak_ptr{ m_status }; + } + + public: + + TaskSynchronizer() = default; + + /** Destructor, joining tasks synchronized with this object. + @see join_tasks() + */ + ~TaskSynchronizer() + { + join_tasks(); + } + + TaskSynchronizer(const TaskSynchronizer&) = delete; + TaskSynchronizer& operator=(const TaskSynchronizer&) = delete; + + TaskSynchronizer(TaskSynchronizer&& other) noexcept = delete; + TaskSynchronizer& operator=(TaskSynchronizer&& other) noexcept = delete; + + /** Wrap the provided callable into a similar but synchronized callable. + + The wrapper guarantees that if the resulting callable is invoked: + - if the joining function of this synchronizer have been called, skip execution; + - if the joining function of this synchronizer is called while the callback is + invoked, it will block until the end of the body of the original callable; + - if no joining function have been called yet, notify the synchronizer that the + execution begins, then execute the body; + + @param work Any callable object with no arguments. The return value will be ignored. + @return A wrapped version of the provided callable object, adding checks + preventing execution of the original callable body if any joining function + of this synchronizer was called. + */ + template + auto synchronized(Work&& work) + { + return [this, + new_work = std::forward(work), + remote_status = make_remote_status()](auto&&... args) mutable + { + // If status is alive then we know the TaskSynchronizer is alive too. + auto status = remote_status.lock(); + if (status && !status->join_requested) // Don't add running tasks while join was + // requested. + { // We can use 'this' safely in this scope. + notify_begin_execution(); + on_scope_exit _{ [&, this] + { + status.reset(); // Make sure we are not keeping the + // TaskSynchronizer waiting + notify_end_execution(); + } }; + std::invoke(new_work, std::forward(args)...); + } + }; + } + + /** Notify all synchronized tasks and blocks until all already started synchronized tasks + are done. + + This is a joining function: once it is called, no synchronized task body will be + executed again. Synchronized tasks which body is being executed will notify this + synchronizer once done. + + Only returns once all the executing tasks have finished finishes. + + After calling this, is_joined() will return true. + */ + void join_tasks() + { + wait_all_running_tasks(); + assert(is_joined()); + } + + /** Join synchronized tasks and reset this object's state to be reusable like if it was just + constructed. + + Similar to calling join_tasks() but is_joined() will return false after calling this. + + @see join_tasks() + */ + void reset() + { + join_tasks(); + m_status = std::make_shared(); + assert(!is_joined()); + } + + /** @return true if all synchronized tasks have been joined, false otherwise. @see + * join_tasks(), reset()*/ + bool is_joined() const + { + return !m_status && m_running_tasks == 0; + } + + /** @return Number of synchronized tasks which are currently being executed. */ + int64_t running_tasks() const + { + return m_running_tasks; + } + + private: + + struct Status + { + std::atomic join_requested{ false }; + }; + + std::atomic m_running_tasks{ 0 }; + + std::shared_ptr m_status = std::make_shared(); + + std::mutex m_mutex; + std::condition_variable m_task_end_condition; + + void notify_begin_execution() + { + ++m_running_tasks; + } + + void notify_end_execution() + { + { + std::unique_lock exit_lock{ m_mutex }; + --m_running_tasks; + } + m_task_end_condition.notify_one(); + } + + void wait_all_running_tasks() + { + if (!m_status) + { + return; + } + + std::unique_lock exit_lock{ m_mutex }; + + auto remote_status = make_remote_status(); + m_status->join_requested = true; + m_status.reset(); + + m_task_end_condition.wait( + exit_lock, + [&] { return m_running_tasks == 0 && remote_status.expired(); } + ); + } + }; + +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/thread_utils.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/thread_utils.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f915c9aad62efbfcf3034f2d617adf7b93879474 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/thread_utils.hpp @@ -0,0 +1,232 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_THREAD_UTILS_HPP +#define MAMBA_CORE_THREAD_UTILS_HPP + +#include +#include +#include +#include +#include +#include +#include + +namespace mamba +{ + + /*********************** + * thread interruption * + ***********************/ + + + using signal_handler_t = void (*)(int); + +#ifndef _WIN32 + void set_signal_handler(const std::function& handler); + + int stop_receiver_thread(); + int kill_receiver_thread(); + void reset_sig_interrupted(); +#endif + + void set_default_signal_handler(); + void restore_previous_signal_handler(); + signal_handler_t previous_signal_handler(); + bool is_sig_interrupted() noexcept; + void set_sig_interrupted() noexcept; + + void interruption_point(); + + class thread_interrupted : public std::exception + { + public: + + thread_interrupted() = default; + + const char* what() const throw() + { + return "Thread interrupted"; + } + }; + + /**************** + * thread count * + ****************/ + + void increase_thread_count(); + void decrease_thread_count(); + int get_thread_count(); + + // Waits until all other threads have finished + // Must be called by the cleaning thread to ensure + // it won't free resources that could be required + // by threads still active. + void wait_for_all_threads(); + + /********** + * thread * + **********/ + + // Thread that increases the threads count upon + // creation and decreases it upon deletion. Use it + // when you need to ensure all threads have exited + class thread + { + public: + + thread() = default; + ~thread() = default; + + thread(const thread&) = delete; + thread& operator=(const thread&) = delete; + + thread(thread&&) noexcept = default; + thread& operator=(thread&&) = default; + + template + explicit thread(Function&& func, Args&&... args); + + bool joinable() const noexcept; + std::thread::id get_id() const noexcept; + + void join(); + void detach(); + std::thread::native_handle_type native_handle(); + + std::thread extract() + { + return std::move(m_thread); + } + + private: + + std::thread m_thread; + }; + + template + inline thread::thread(Function&& func, Args&&... args) + { + increase_thread_count(); + auto f = std::bind(std::forward(func), std::forward(args)...); + m_thread = std::thread( + [f]() + { + try + { + f(); + } + catch (thread_interrupted&) + { + errno = EINTR; + } + decrease_thread_count(); + } + ); + } + + /********************** + * interruption_guard * + **********************/ + + class interruption_guard + { + public: + + template + interruption_guard(Function&& func, Args&&... args); + ~interruption_guard(); + + interruption_guard(const interruption_guard&) = delete; + interruption_guard& operator=(const interruption_guard&) = delete; + + interruption_guard(interruption_guard&&) = delete; + interruption_guard& operator=(interruption_guard&&) = delete; + + private: + + static std::function m_cleanup_function; + }; + + template + inline interruption_guard::interruption_guard(Function&& func, Args&&... args) + { + m_cleanup_function = std::bind(std::forward(func), std::forward(args)...); + } + + class counting_semaphore + { + public: + + inline counting_semaphore(std::ptrdiff_t max = 0); + inline void lock(); + inline void unlock(); + inline std::ptrdiff_t get_max(); + inline void set_max(std::ptrdiff_t value); + + private: + + std::ptrdiff_t m_value, m_max; + std::mutex m_access_mutex; + std::condition_variable m_cv; + }; + + /************************************* + * counting_semaphore implementation * + *************************************/ + + inline counting_semaphore::counting_semaphore(std::ptrdiff_t max) + { + set_max(max); + m_value = m_max; + } + + inline void counting_semaphore::lock() + { + std::unique_lock lock{ m_access_mutex }; + m_cv.wait(lock, [&]() { return m_value > 0; }); + --m_value; + } + + inline void counting_semaphore::unlock() + { + { + std::unique_lock lock{ m_access_mutex }; + if (++m_value <= 0) + { + return; + } + } + m_cv.notify_all(); + } + + inline std::ptrdiff_t counting_semaphore::get_max() + { + return m_max; + } + + inline void counting_semaphore::set_max(std::ptrdiff_t value) + { + std::ptrdiff_t new_max; + if (value == 0) + { + new_max = std::thread::hardware_concurrency(); + } + else if (value < 0) + { + new_max = std::thread::hardware_concurrency() + value; + } + else + { + new_max = value; + } + + m_value += new_max - m_max; + m_max = new_max; + } +} // namespace mamba + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/timeref.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/timeref.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1019e42f75dbc470267a07a45520ee7568cd41e0 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/timeref.hpp @@ -0,0 +1,33 @@ +#ifndef MAMBA_CORE_TIMEREF_HPP +#define MAMBA_CORE_TIMEREF_HPP + +#include +#include + +namespace mamba::validation +{ + + /** Define a time reference. + * TUF 5.1 'Record fixed update start time' + * https://theupdateframework.github.io/specification/latest/#fix-time + */ + class TimeRef + { + public: + + void set(const std::time_t& time); + void set_now(); + std::string timestamp() const; + + TimeRef(const std::time_t& time); + TimeRef(); + ~TimeRef() = default; + + private: + + std::time_t m_time_ref; + }; + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/transaction.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/transaction.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f6bf5d13738ad57625b28bd94fbefc3fdd58934b --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/transaction.hpp @@ -0,0 +1,119 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_TRANSACTION_HPP +#define MAMBA_CORE_TRANSACTION_HPP + +#include +#include +#include + +#include "mamba/api/install.hpp" +#include "mamba/core/package_cache.hpp" +#include "mamba/core/prefix_data.hpp" +#include "mamba/fs/filesystem.hpp" +#include "mamba/solver/libsolv/database.hpp" +#include "mamba/solver/solution.hpp" +#include "mamba/specs/match_spec.hpp" +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + namespace solver + { + struct Request; + } + + class ChannelContext; + class Context; + + class MTransaction + { + public: + + MTransaction( + const Context& ctx, + solver::libsolv::Database& database, + std::vector pkgs_to_remove, + std::vector pkgs_to_install, + MultiPackageCache& caches + ); + + MTransaction( + const Context& ctx, + solver::libsolv::Database& database, + const solver::Request& request, + solver::Solution solution, + MultiPackageCache& caches + ); + + // Only use if the packages have been solved previously already. + MTransaction( + const Context& ctx, + solver::libsolv::Database& database, + std::vector packages, + MultiPackageCache& caches + ); + + MTransaction(const MTransaction&) = delete; + MTransaction(MTransaction&&) = delete; + MTransaction& operator=(const MTransaction&) = delete; + MTransaction& operator=(MTransaction&&) = delete; + + using to_install_type = std::vector>; + using to_remove_type = std::vector>; + using to_specs_type = std::tuple, std::vector>; + using to_conda_type = std::tuple; + + to_conda_type to_conda(); + void log_json(); + bool fetch_extract_packages(const Context& ctx, ChannelContext& channel_context); + bool empty(); + bool prompt(const Context& ctx, ChannelContext& channel_context); + void print(const Context& ctx, ChannelContext& channel_context); + bool execute(const Context& ctx, ChannelContext& channel_context, PrefixData& prefix); + + private: + + MultiPackageCache m_multi_cache; + History::UserRequest m_history_entry; + solver::Solution m_solution; + + /** Pair of current Python version, and potential update. */ + std::pair m_py_versions; + /** + * The potential "python_site_package" entry. + * + * Found in the the new or installed python interpreter. + * Key is added as part of CEP-17. + * https://conda.org/learn/ceps/cep-0017 + */ + std::string m_python_site_packages_path; + std::vector m_requested_specs; + + MTransaction(const CommandParams& command_params, MultiPackageCache&); + }; + + MTransaction create_explicit_transaction_from_urls( + const Context& ctx, + solver::libsolv::Database& database, + const std::vector& urls, + MultiPackageCache& package_caches, + std::vector& other_specs + ); + + MTransaction create_explicit_transaction_from_lockfile( + const Context& ctx, + solver::libsolv::Database& database, + const fs::u8path& env_lockfile_path, + const std::vector& categories, + MultiPackageCache& package_caches, + std::vector& other_specs + ); + +} // namespace mamba + +#endif // MAMBA_TRANSACTION_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util.hpp new file mode 100644 index 0000000000000000000000000000000000000000..592d002c5327c3cf6ab007b89c4c1634e35f41fe --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util.hpp @@ -0,0 +1,414 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_UTIL_HPP +#define MAMBA_CORE_UTIL_HPP + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mamba/core/context_params.hpp" +#include "mamba/core/error_handling.hpp" +#include "mamba/fs/filesystem.hpp" + +#include "tl/expected.hpp" + +#define MAMBA_EMPTY_SHA "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + +namespace mamba +{ + const std::regex& token_regex(); + const std::regex& http_basicauth_regex(); + + /** + * Expand environment variables present in `s` + * if matching R"(\$(\{\w+\}|\w+))" regex. + */ + std::string expandvars(std::string s); + + // Used when we want a callback which does nothing. + struct no_op + { + void operator()() const noexcept + { + } + }; + + bool lexists(const fs::u8path& p); + bool lexists(const fs::u8path& p, std::error_code& ec); + std::vector filter_dir(const fs::u8path& dir, const std::string& suffix); + bool paths_equal(const fs::u8path& lhs, const fs::u8path& rhs); + + std::string + read_contents(const fs::u8path& path, std::ios::openmode mode = std::ios::in | std::ios::binary); + std::vector read_lines(const fs::u8path& path); + + inline void make_executable(const fs::u8path& p) + { + fs::permissions( + p, + fs::perms::owner_all | fs::perms::group_all | fs::perms::others_read | fs::perms::others_exec + ); + } + + // @return `true` if `TemporaryFile` will not delete files once destroy. + // If `set_persist_temporary_files` was not called, returns `false` by default. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe accessor for a global parameter: the returned value is + // therefore obsolete before being obtained and should be considered as a hint. + bool must_persist_temporary_files(); + + // Controls if `TemporaryFile` will delete files once destroy or not. + // This is useful for debugging situations where temporary data lead to unexpected behavior. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe function setting a global parameter: if concurrent threads + // are both calling this function with different value there is no guarantee as to which + // value will be retained. + // However if there is exactly one thread executing this function then the following is true: + // const auto result = set_persist_temporary_files(must_persist); + // result == must_persist && must_persist_temporary_files() == must_persist + bool set_persist_temporary_files(bool will_persist); + + // @return `true` if `TemporaryDirectory` will not delete files once destroy. + // If `set_persist_temporary_files` was not called, returns `false` by default. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe accessor for a global parameter: the returned value is + // therefore obsolete before being obtained and should be considered as a hint. + bool must_persist_temporary_directories(); + + // Controls if `TemporaryDirectory` will delete files once destroy or not. + // This is useful for debugging situations where temporary data lead to unexpected behavior. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe function setting a global parameter: if concurrent threads + // are both calling this function with different value there is no guarantee as to which + // value will be retained. + // However if there is exactly one thread executing this function then the following is true: + // const auto result = set_persist_temporary_directories(must_persist); + // result == must_persist && must_persist_temporary_directories() == must_persist + bool set_persist_temporary_directories(bool will_persist); + + class TemporaryDirectory + { + public: + + TemporaryDirectory(); + ~TemporaryDirectory(); + + TemporaryDirectory(const TemporaryDirectory&) = delete; + TemporaryDirectory& operator=(const TemporaryDirectory&) = delete; + TemporaryDirectory& operator=(TemporaryDirectory&&) = default; + + const fs::u8path& path() const; + operator fs::u8path(); + + private: + + fs::u8path m_path; + }; + + class TemporaryFile + { + public: + + TemporaryFile( + const std::string& prefix = "mambaf", + const std::string& suffix = "", + const std::optional& dir = std::nullopt + ); + ~TemporaryFile(); + + TemporaryFile(const TemporaryFile&) = delete; + TemporaryFile& operator=(const TemporaryFile&) = delete; + TemporaryFile& operator=(TemporaryFile&&) = default; + + fs::u8path& path(); + operator fs::u8path(); + + private: + + fs::u8path m_path; + }; + + const std::size_t MAMBA_LOCK_POS = 21; + + class LockFileOwner; + + // @return `true` if constructing a `LockFile` will result in locking behavior, `false` if + // using `LockFile will not lock the file and behave like a no-op. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe accessor for a global parameter: the returned value is + // therefore obsolete before being obtained and should be considered as a hint. + bool is_file_locking_allowed(); + + + // Controls if, with `true`, constructing a `LockFile` will result in locking behavior, + // or, with `false, will not lock the file and behave like a no-op. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe function setting a global parameter: if concurrent threads + // are both calling this function with different value there is no guarantee as to which + // value will be retained. + // However if there is exactly one thread executing this function then the following is true: + // const auto result = allow_file_locking(allow); + // result == allow && is_file_locking_allowed() == allow + bool allow_file_locking(bool allow); + + // @return The file locking timeout used by `LockFile` at construction. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe accessor for a global parameter: the returned value is + // therefore obsolete before being obtained and should be considered as a hint. + std::chrono::seconds default_file_locking_timeout(); + + // Changes the locking duration when `LockFile` is constructed without a specified locking + // timeout. + // + // @warning This function must be called in the execution scope `main()`, doing otherwise leads + // to undefined behavior. + // + // @warning This is a thread-safe function setting a global parameter: if concurrent threads + // are both calling this function with different value there is no guarantee as to which + // value will be retained. + // However if there is exactly one thread executing this function then the following is true: + // const auto result = set_file_locking_timeout(timeout); + // result == timeout && default_file_locking_timeout() == timeout + std::chrono::seconds set_file_locking_timeout(const std::chrono::seconds& new_timeout); + + // This is a non-throwing file-locking mechanism. + // It can be used on a file or directory path. In the case of a directory path a file will be + // created to be locked. The locking will be implemented using the OS's filesystem locking + // capabilities, if available. + // + // Once constructed, use `is_locked()` or `operator bool` to check if the lock did happen + // successfully. When locking fails because of an error, the error can be retrieved using + // `error()`. When attempting to lock a path which is already locked by another process, the + // attempt will fail and `is_locked()` will return false. + // + // When the same process attempts to lock the same path more than once (multiple instances of + // `LockFile` target the same path), creating a new `LockFile` for that path will always succeed + // and increment the lock owner count which can be retrieved using `count_lock_owners()`. + // Basically, all instacnes of `LockFile` locking the same path are sharing the lock, which will + // only be released once there is no instance alive. + // + // Use `mamba::allow_file_locking(false)` to never have locking happen, in which case + // the created `LockFile` instance will not be locked (`is_locked()` will return false) but will + // have no error either (`error()` will return `noopt`). + // + // Example: + // using namespace mamba; + // LockFile some_work_on(some_path) + // { + // LockFile lock{ some_path, timeout }; + // if(lock) // make sure the locking happened + // { + // print("locked file {}, locking counts: {}", some_path, + // lock.count_lock_owners()); // success might mean we are locking the same path + // from multiple threads do_something(some_path); // locking was a success + // } + // else // locking didnt succeed for some reason + // { + // if(auto error = lock.error) print(error); // some error happened while + // attempting the lock, maybe some other process already locks the path else + // print("didn't attempt locking {}", some_path); // locking didn't happen for some + // other reason, maybe a configuration option + // } + // some_more_work(some_path); // do this that the lock failed or not + // return lock; // The locking ownership can be transferred to another function if + // necessary + // } + // + class LockFile + { + public: + + // Non-throwing constructors, attempting lock on the provided path, file or directory. + // In case of a directory, a lock-file will be created, located at `this->lockfile_path()` + // and `this->is_locked()` (and `if(*this))` will always return true (unless this instance + // is moved-from). If the lock acquisition failed or `allow_file_locking(false)` and until + // re-assigned: + // - `this->is_locked() == false` and `if(*this) ...` will go in the `false` branch. + // - accessors will throw, except `is_locked()`, `count_lock_owners()`, and `error()` + explicit LockFile(const fs::u8path& path); + LockFile(const fs::u8path& path, const std::chrono::seconds& timeout); + + ~LockFile(); + + LockFile(const LockFile&) = delete; + LockFile& operator=(const LockFile&) = delete; + + LockFile(LockFile&&); + LockFile& operator=(LockFile&&); + + // Returns true if this LockFile is currently maintaining a lock on the target path. + // Returns false if this instance have been moved-from without being re-assigned, + // or if the lock acquisition failed. + bool is_locked() const + { + return impl.has_value() // we have a owner + && (impl.value() ? true : false); // it's not null + } + + // Convenient operator to check if a lockfile is actually locking a path. + explicit operator bool() const + { + return is_locked(); + } + + // Returns the fd of the path being locked, throws if `is_locked() == false`. + int fd() const; + + // Returns the path being locked, throws if `is_locked() == false`. + fs::u8path path() const; + + // Returns the path of the lock-file being locked, throws if `is_locked() == false`. + fs::u8path lockfile_path() const; + + // Returns the count of LockFile instances which are currently locking + // the same path/file from the same process. + // Returns 0 if `is_locked() == false`. + std::size_t count_lock_owners() const + { + return std::size_t(impl.has_value() ? impl.value().use_count() : 0); + } + +#ifdef _WIN32 + // Using file descriptor on Windows may cause false negative + static bool is_locked(const fs::u8path& path); +#else + // Opening a new file descriptor on Unix would clear locks + static bool is_locked(int fd); +#endif + + static bool is_locked(const LockFile& lockfile) + { + return lockfile.is_locked() && +#ifdef _WIN32 + is_locked(lockfile.lockfile_path()); +#else + // Opening a new file descriptor on Unix would clear locks + is_locked(lockfile.fd()); +#endif + } + + std::optional error() const + { + if (impl.has_value()) + { + return {}; + } + else + { + return impl.error(); + } + } + + private: + + tl::expected, mamba_error> impl; + }; + + void split_package_extension(const std::string& file, std::string& name, std::string& extension); + + std::string + quote_for_shell(const std::vector& arguments, const std::string& shell = ""); + + std::size_t clean_trash_files(const fs::u8path& prefix, bool deep_clean); + std::size_t remove_or_rename(const fs::u8path& target_prefix, const fs::u8path& path); + + // Unindent a string literal + std::string unindent(const char* p); + + std::string prepend(const std::string& p, const char* start, const char* newline = ""); + + std::string prepend(const char* p, const char* start, const char* newline = ""); + + std::string timestamp(const std::time_t& time); + + std::time_t utc_time_now(); + + std::string utc_timestamp_now(); + + std::time_t parse_utc_timestamp(const std::string& timestamp, int& error_code) noexcept; + + std::time_t parse_utc_timestamp(const std::string& timestamp); + + std::ofstream + open_ofstream(const fs::u8path& path, std::ios::openmode mode = std::ios::out | std::ios::binary); + + std::ifstream + open_ifstream(const fs::u8path& path, std::ios::openmode mode = std::ios::in | std::ios::binary); + + bool ensure_comspec_set(); + + std::unique_ptr wrap_call( + const fs::u8path& root_prefix, + const fs::u8path& prefix, + const std::vector& arguments, // TODO: c++20 replace by std::span + bool is_mamba_exe = false + ); + + struct PreparedWrappedCall + { + std::vector wrapped_command; + std::unique_ptr temporary_file; + }; + + PreparedWrappedCall prepare_wrapped_call( + const PrefixParams& prefix_params, + const std::vector& cmd, + bool is_mamba_exe + ); + + /// Returns `true` if the filename matches names of files which should be interpreted as YAML. + /// NOTE: this does not check if the file exists. + bool is_yaml_file_name(std::string_view filename); + + std::optional + proxy_match(const std::string& url, const std::map& proxy_servers); + + std::string hide_secrets(std::string_view str); + + class non_copyable_base + { + public: + + non_copyable_base() + { + } + + private: + + non_copyable_base(const non_copyable_base&); + non_copyable_base& operator=(const non_copyable_base&); + }; +} // namespace mamba + +#endif // MAMBA_UTIL_HPP diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_os.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_os.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8be943d5e075fc8cef8441b27d0a11d3b3c4d6a4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_os.hpp @@ -0,0 +1,61 @@ +// Copyright (c) 2019-2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_UTIL_OS_HPP +#define MAMBA_CORE_UTIL_OS_HPP + +#include +#include + +#include "mamba/core/fsutil.hpp" +#include "mamba/core/palette.hpp" + +namespace mamba +{ +#ifdef _WIN32 + // Intention is to avoid including `Windows.h`, while still using the basic Windows API types. + using DWORD = unsigned long; +#endif + + bool is_admin(); + fs::u8path get_self_exe_path(); + fs::u8path get_libmamba_path(); + + using PID = +#ifdef _WIN32 + DWORD +#else + int +#endif + ; + + std::string get_process_name_by_pid(const PID pid); +#ifdef _WIN32 + PID getppid(); +#endif + + void run_as_admin(const std::string& args); + bool enable_long_paths_support(bool force, Palette palette = Palette::no_color()); + + void init_console(); + void reset_console(); + + /* Test whether a given `std::ostream` object refers to a terminal. */ + bool is_atty(const std::ostream& stream); + + struct ConsoleFeatures + { + bool virtual_terminal_processing, true_colors; + }; + + ConsoleFeatures get_console_features(); + int get_console_width(); + int get_console_height(); + + void codesign(const fs::u8path& path, bool verbose = false); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_scope.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_scope.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4323aeb61c132447ed741dc4a969d4d27ae2e12a --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/util_scope.hpp @@ -0,0 +1,48 @@ + +#ifndef MAMBA_CORE_UTIL_SCOPE_HPP +#define MAMBA_CORE_UTIL_SCOPE_HPP + +#include + +#include "mamba/core/output.hpp" + +#include "spdlog/spdlog.h" + +namespace mamba +{ + + template + struct on_scope_exit + { + F func; + + explicit on_scope_exit(F&& f) + : func(std::forward(f)) + { + } + + ~on_scope_exit() + { + try + { + func(); + } + catch (const std::exception& ex) + { + LOG_ERROR << fmt::format("Scope exit error (caught and ignored): {}", ex.what()); + } + catch (...) + { + LOG_ERROR << "Scope exit unknown error (caught and ignored)"; + } + } + + // Deactivate copy & move until we implement moves + on_scope_exit(const on_scope_exit&) = delete; + on_scope_exit& operator=(const on_scope_exit&) = delete; + on_scope_exit(on_scope_exit&&) = delete; + on_scope_exit& operator=(on_scope_exit&&) = delete; + }; +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/virtual_packages.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/virtual_packages.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6111e6a34739918027a0b69620c2ff03804b41d4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/core/virtual_packages.hpp @@ -0,0 +1,36 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_VIRTUAL_PACKAGES_HPP +#define MAMBA_CORE_VIRTUAL_PACKAGES_HPP + +#include +#include + +#include "mamba/specs/package_info.hpp" + +namespace mamba +{ + class Context; + + std::vector get_virtual_packages(const std::string& platform); + + namespace detail + { + std::string cuda_version(); + + auto make_virtual_package( + std::string name, + std::string subdir, + std::string version = "", + std::string build_string = "" + ) -> specs::PackageInfo; + + std::vector dist_packages(const std::string& platform); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/downloader.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/downloader.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ec1f04d8796114813e32124f7257e012903a9893 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/downloader.hpp @@ -0,0 +1,68 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_DOWNLOAD_DOWNLOADER_HPP +#define MAMBA_DOWNLOAD_DOWNLOADER_HPP + +#include + +#include + +#include "mamba/download/mirror_map.hpp" +#include "mamba/download/parameters.hpp" +#include "mamba/download/request.hpp" +#include "mamba/specs/authentication_info.hpp" + +namespace mamba::download +{ + class Monitor + { + public: + + virtual ~Monitor() = default; + + Monitor(const Monitor&) = delete; + Monitor& operator=(const Monitor&) = delete; + Monitor(Monitor&&) = delete; + Monitor& operator=(Monitor&&) = delete; + + void observe(MultiRequest& requests, Options& options); + void on_done(); + void on_unexpected_termination(); + + protected: + + Monitor() = default; + + private: + + virtual void observe_impl(MultiRequest& requests, Options& options) = 0; + virtual void on_done_impl() = 0; + virtual void on_unexpected_termination_impl() = 0; + }; + + MultiResult download( + MultiRequest requests, + const mirror_map& mirrors, + const RemoteFetchParams& params, + const specs::AuthenticationDataBase& auth_info, + Options options = {}, + Monitor* monitor = nullptr + ); + + Result download( + Request request, + const mirror_map& mirrors, + const RemoteFetchParams& params, + const specs::AuthenticationDataBase& auth_info, + Options options = {}, + Monitor* monitor = nullptr + ); + + bool check_resource_exists(const std::string& url, const RemoteFetchParams& params); +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1fa5e38b5364d69cbb51197a20240065a1fa26c4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror.hpp @@ -0,0 +1,131 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_DOWNLOAD_MIRROR_HPP +#define MAMBA_DOWNLOAD_MIRROR_HPP + +#include +#include +#include +#include +#include + +#include + +#include "mamba/download/request.hpp" +#include "mamba/util/synchronized_value.hpp" + +namespace mamba::download +{ + class MirrorID + { + public: + + explicit MirrorID(std::string v); + + std::string to_string() const; + + friend bool operator<(const MirrorID& lhs, const MirrorID& rhs); + friend bool operator==(const MirrorID& lhs, const MirrorID& rhs); + + private: + + std::string m_value; + }; + + struct MirrorRequest : RequestBase + { + using header_list = std::vector; + + std::string url; + header_list headers; + bool is_repodata_zst; + std::string username = {}; + std::string password = {}; + + MirrorRequest( + std::string_view name, + std::string_view url, + header_list headers = {}, + bool is_repodata_zst = false + ); + MirrorRequest( + const RequestBase& base, + std::string_view url, + header_list headers = {}, + bool is_repodata_zst = false + ); + + ~MirrorRequest() = default; + MirrorRequest(const MirrorRequest&) = default; + MirrorRequest& operator=(const MirrorRequest&) = default; + MirrorRequest(MirrorRequest&&) = default; + MirrorRequest& operator=(MirrorRequest&&) = default; + }; + + struct MirrorStats // Moved out of Mirror internals because of compilers not agreeing: + // https://godbolt.org/z/GcjWhrb9W + { + std::optional allowed_connections = std::nullopt; + std::size_t max_tried_connections = 0; + std::size_t running_transfers = 0; + std::size_t successful_transfers = 0; + std::size_t failed_transfers = 0; + }; + + // A Mirror represents a location from where an asset can be downloaded. + // It handles the generation of required requests to get the asset, and + // provides some statistics about its usage. + class Mirror + { + public: + + using request_generator = std::function; + using request_generator_list = std::vector; + + virtual ~Mirror() = default; + + Mirror(const Mirror&) = delete; + Mirror& operator=(const Mirror&) = delete; + Mirror(Mirror&&) = delete; + Mirror& operator=(Mirror&&) = delete; + + const MirrorID& id() const; + request_generator_list + get_request_generators(const std::string& url_path, const std::string& spec_sha256) const; + + std::size_t max_retries() const; + std::size_t successful_transfers() const; + std::size_t failed_transfers() const; + + bool can_accept_more_connections() const; + bool can_retry_with_fewer_connections() const; + + void cap_allowed_connections(); + void increase_running_transfers(); + void update_transfers_done(bool success, bool record_success); + + protected: + + explicit Mirror(MirrorID id, std::size_t max_retries = 3); + + private: + + virtual request_generator_list get_request_generators_impl(const std::string&, const std::string&) const = 0; + + MirrorID m_id; + size_t m_max_retries; + + static_assert(std::default_initializable); + + util::synchronized_value m_stats; + }; + + std::unique_ptr make_mirror(std::string url); + +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror_map.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror_map.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bbc9b71770b6d6e7f03ad2d7e44582875682f21b --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/mirror_map.hpp @@ -0,0 +1,91 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_DOWNLOAD_MIRROR_MAP_HPP +#define MAMBA_DOWNLOAD_MIRROR_MAP_HPP + +#include +#include +#include +#include +#include +#include + +#include "mamba/download/mirror.hpp" +#include "mamba/util/iterator.hpp" + +namespace mamba::download +{ + using mirror_ptr = std::unique_ptr; + using mirror_set = std::vector; + using mirror_set_view = util::view::range_all; + + class mirror_map + { + public: + + mirror_map(); + ~mirror_map() = default; + + mirror_map(const mirror_map&) = delete; + mirror_map& operator=(const mirror_map&) = delete; + + mirror_map(mirror_map&&) = default; + mirror_map& operator=(mirror_map&&) = default; + + std::size_t size() const; + + // Returns true if there are registered mirrors stored here, false if none are. + bool has_mirrors(std::string_view mirror_name) const; + + // Get a list of unique mirrors if existing for the provided mirror name, or an empty list + // otherwise. + mirror_set_view get_mirrors(std::string_view mirror_name) const; + + // Stores a provided Mirror IFF no other mirror is already registered with the same id for + // the specified mirror name. Returns true if the mirror has been stored, false otherwise. + bool add_unique_mirror(std::string_view mirror_name, mirror_ptr mirror); + + // Creates, stores and returns a new instance of `MirrorType` created with `args` IFF no + // other mirror is already registered with the same id for the specified mirror name, + // returns null otherwise. + template + auto create_unique_mirror(const std::string& mirror_name, Args&&... args) -> MirrorType&; + + private: + + using map_type = std::unordered_map; + + mirror_set m_empty_set; + map_type m_mirrors; + }; + + template + auto mirror_map::create_unique_mirror(const std::string& mirror_name, Args&&... args) + -> MirrorType& + { + static_assert(std::is_base_of_v); + + const auto new_id = MirrorType::make_id(args...); + + auto& mirrors = m_mirrors[mirror_name]; + auto iter = std::find_if( + mirrors.begin(), + mirrors.end(), + [new_id](auto& mirror) { return new_id == mirror->id(); } + ); + if (iter != mirrors.end()) + { + return dynamic_cast(**iter); + } + + auto mirror = std::make_unique(std::forward(args)...); + mirrors.push_back(std::move(mirror)); + return dynamic_cast(*(mirrors.back())); + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/parameters.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/parameters.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f08c6d42bd84f0085a56143f86a16f6580b381f7 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/parameters.hpp @@ -0,0 +1,49 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_DOWNLOAD_PARAMETERS_HPP +#define MAMBA_DOWNLOAD_PARAMETERS_HPP + +#include +#include +#include +#include + +namespace mamba::download +{ + struct RemoteFetchParams + { + // ssl_verify can be either an empty string (regular SSL verification), + // the string "" to indicate no SSL verification, or a path to + // a directory with cert files, or a cert file. + std::string ssl_verify = ""; + bool ssl_no_revoke = false; + bool curl_initialized = false; // non configurable, used in fetch only + + std::string user_agent = ""; + + double connect_timeout_secs = 10.; + // int read_timeout_secs { 60 }; + int retry_timeout = 2; // seconds + int retry_backoff = 3; // retry_timeout * retry_backoff + int max_retries = 3; // max number of retries + + std::map proxy_servers; + }; + + struct Options + { + using termination_function = std::optional>; + + std::size_t download_threads = 1; + bool fail_fast = false; + bool sort = true; + bool verbose = false; + termination_function on_unexpected_termination = std::nullopt; + }; + +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/request.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/request.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0a35fee101c9ca185bada949c13a053529e6aaf4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/download/request.hpp @@ -0,0 +1,184 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_DOWNLOAD_REQUEST_HPP +#define MAMBA_DOWNLOAD_REQUEST_HPP + +#include +#include +#include +#include +#include + +#include "mamba/core/error_handling.hpp" + +namespace mamba::download +{ + /******************************* + * Download results structures * + *******************************/ + + struct TransferData + { + int http_status = 0; + std::string effective_url = ""; + std::size_t downloaded_size = 0; + std::size_t average_speed_Bps = 0; + }; + + struct Filename + { + std::string value = ""; + }; + + struct Buffer + { + std::string value = ""; + }; + + using Content = std::variant; + + struct Success + { + Content content = {}; + TransferData transfer = {}; + std::string cache_control = ""; + std::string etag = ""; + std::string last_modified = ""; + std::size_t attempt_number = std::size_t(1); + }; + + struct Error + { + std::string message = ""; + std::optional retry_wait_seconds = std::nullopt; + std::optional transfer = std::nullopt; + std::size_t attempt_number = std::size_t(1); + }; + + using Result = tl::expected; + using MultiResult = std::vector; + + /***************************** + * Download event structures * + *****************************/ + + struct Progress + { + std::size_t downloaded_size = 0; + std::size_t total_to_download = 0; + std::size_t speed_Bps = 0; + }; + + using Event = std::variant; + + /******************************* + * Download request structures * + *******************************/ + + struct RequestBase + { + using progress_callback_t = std::function; + + // TODO: remove these functions when we plug a library with continuation + using on_success_callback_t = std::function(const Success&)>; + using on_failure_callback_t = std::function; + + std::string name; + // If filename is not initialized, the data will be downloaded + // to an internal in-memory buffer. + std::optional filename; + bool check_only; + bool ignore_failure; + std::optional expected_size = std::nullopt; + std::optional etag = std::nullopt; + std::optional last_modified = std::nullopt; + + std::optional progress = std::nullopt; + std::optional on_success = std::nullopt; + std::optional on_failure = std::nullopt; + + protected: + + RequestBase( + std::string_view lname, + std::optional lfilename, + bool lcheck_only, + bool lignore_failure + ); + + ~RequestBase() = default; + RequestBase(const RequestBase&) = default; + RequestBase& operator=(const RequestBase&) = default; + RequestBase(RequestBase&&) = default; + RequestBase& operator=(RequestBase&&) = default; + }; + + // This class is used to create strong alias on + // string_view. This helps to avoid error-prone + // calls to functions that accept many arguments + // of the same type + template + class string_view_alias + { + public: + + explicit string_view_alias(std::string_view s); + operator std::string_view() const; + + private: + + std::string_view m_wrapped; + }; + + using MirrorName = string_view_alias<0>; + + struct Request : RequestBase + { + std::string mirror_name; + std::string url_path; + // TODO maybe we would want to use a struct instead + // containing the `checksum` and its `type` + // (to handle other checksums types like md5...) + // cf. `Checksum` struct in powerloader + std::string sha256; + + Request( + std::string_view lname, + MirrorName lmirror_name, + std::string_view lurl_path, + std::optional lfilename = std::nullopt, + bool lhead_only = false, + bool lignore_failure = false + ); + + ~Request() = default; + Request(const Request&) = default; + Request& operator=(const Request&) = default; + Request(Request&&) = default; + Request& operator=(Request&&) = default; + }; + + using MultiRequest = std::vector; + + /************************************ + * string_view_alias implementation * + ************************************/ + + template + string_view_alias::string_view_alias(std::string_view s) + : m_wrapped(s) + { + } + + template + string_view_alias::operator std::string_view() const + { + return m_wrapped; + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/fs/filesystem.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/fs/filesystem.hpp new file mode 100644 index 0000000000000000000000000000000000000000..aff43b5b4255dac18fa5e37db64b88abee1e47b8 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/fs/filesystem.hpp @@ -0,0 +1,1339 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_FS_FILESYSTEM_HPP +#define MAMBA_FS_FILESYSTEM_HPP + +#include +#include + +#include + +//---- RATIONALE: Why do we wrap standard filesystem here? ---- +// 1. This codebase relies on `std::string` and `const char*` to denote UTF-8 encoded text. +// However `std::filesystem::path` constructors cannot assume that `std::string` is in +// another encoding than the default one for the platform. This leads runtime issues on some +// platforms (mostly Windows) where Unicode paths either lead to exceptions being thrown +// by standard filesystem functions or invalid Unicode characters replacing the paths' content. +// To work around these issues we need to make sure `std::string` and other characters are +// assumed to be UTF-8 and paths are built with that knowledge. (The internal storage is optimal +// for the platform so it is not a concern.) In the same way we need paths to be convertible +// to UTF-8 when converting them to string. +// To achieve this we wrap a `std::filesystem::path` into our type `fs::u8path` so that +// conversions always happen correctly in its conversion functions, like an encoding barrier. +// +// 2. Once using `fs::u8path`, we cannot use the standard library filesystem algorithms even with +// `fs::u8path` implicit conversions without risking ending up with `std::filesystem::path` in +// code like this: +// +// fs::u8path prefix = ...; +// prefix = rstrip(fs::weakly_canonical(util::expand_user(prefix)).string(), sep); +// +// Here if `fs::weakly_canonical` is just an alias for `std::filesystem::weakly_canonical` it +// then returns a `std::filesystem::path` and we then call `.string()` on it. That conversion +// assumes that the resulting string should be of the system's encoding (it's unspecified by the +// standard) which leads on Windows for example to the resulting `prefix` with invalid characters +// which are then rejected by directory creation functions used later. +// Another example: +// +// for(const auto& entry : std::filesystem::directory_iterator(some_path)) +// if (ends_with(entry.path().string(), ".json")) { ... +// +// Here `entry` is a `std::filesystem::directory_entry` therefore `.path()` returns a +// `std::filesystem::path` which makes `.string()` return a string with unknown encoding. +// Once passed in `ends_with` which takes a `u8path`, we end up with `???.json` because we +// assumed in `u8path` constructor that this string would be UTF-8 when it is of unknown +// encoding. +// +// This kind of code seems valid but is silently broken. It is very easy to end up in this kind +// of situation which makes us consider this situation brittle. Therefore, the only way to +// prevent this kind of issue is to make sure every path value passed to and returned by +// filesystem functions is first converted to `fs::u8path`, thus giving us guarantees about +// encoding of our paths whatever the platform (as long as strings filtered to be UTF-8). +// +// 3. Previous versions of this header were using another library `ghc::filesystem` which is an +// implementation of the standard filesystem library but with a guarantee that +// `std::filesystem::path::string()` will always return UTF-8 encoding and that constructors +// taking strings will assume that they are UTF-8. Why did we prefer doing our own wrapping? The +// main reason we decided to wrap instead is that we want users of the library to be able to use +// the standard filesystem library in conjunction with this library. As `ghc::filesystem` is a +// re-implementation of `std::filesystem`, both cannot really be used together (or at least not +// without a lot of explicit conversions). With our present wrapping we are completely compatible +// with the standard library as we only add a thin encoding conversion layer over its interface +// (at least until the standard library provides better options). + + +namespace mamba::fs +{ + // sentinel argument for indicating the current time to last_write_time + class now + { + }; + + struct Utf8Options + { + bool normalize_sep = true; + }; + + // Maintain `\` on Windows, `/` on other platforms + std::filesystem::path normalized_separators(std::filesystem::path path); + + // Returns a UTF-8 string given a standard path. + std::string to_utf8(const std::filesystem::path& path, Utf8Options utf8_options = {}); + + // Returns standard path given a UTF-8 string. + std::filesystem::path from_utf8(std::string_view u8string); + + // Same as std::filesystem::path except we only accept and output UTF-8 paths + class u8path + { + public: + + using value_type = char; + using string_type = std::basic_string; + + u8path() = default; + + // Copy is allowed. + u8path(const u8path& other) = default; + u8path& operator=(const u8path& other) = default; + + // Move is allowed. + u8path(u8path&& other) = default; + u8path& operator=(u8path&& other) = default; + + //---- Construction ---- + + u8path(const std::filesystem::path& path) + : m_path(normalized_separators(path)) + { + } + + u8path& operator=(const std::filesystem::path& path) + { + m_path = normalized_separators(path); + return *this; + } + + u8path& operator=(std::filesystem::path&& path) + { + m_path = normalized_separators(std::move(path)); + return *this; + } + + u8path(std::string_view u8string) + : m_path(from_utf8(u8string)) + { + } + + u8path& operator=(std::string_view u8string) + { + m_path = from_utf8(u8string); + return *this; + } + + u8path(const char* u8string) + : m_path(from_utf8(u8string)) + { + } + + u8path& operator=(const char* u8string) + { + m_path = from_utf8(u8string); + return *this; + } + + u8path(const std::string& u8string) + : m_path(from_utf8(u8string)) + { + } + + u8path& operator=(const std::string& u8string) + { + m_path = from_utf8(u8string); + return *this; + } + + u8path& operator=(std::string&& u8string) + { + m_path = from_utf8(std::move(u8string)); + return *this; + } + + //---- Wide character support (Windows usage mostly) - no Unicode conversions. + + u8path(const wchar_t* wstr) + : m_path(normalized_separators(wstr)) + { + } + + u8path& operator=(const wchar_t* wstr) + { + m_path = normalized_separators(wstr); + return *this; + } + + u8path(const std::wstring& wstr) + : m_path(normalized_separators(wstr)) + { + } + + u8path& operator=(const std::wstring& wstr) + { + m_path = normalized_separators(wstr); + return *this; + } + + u8path& operator=(std::wstring&& wstr) + { + m_path = normalized_separators(std::move(wstr)); + return *this; + } + + //---- Append ---- + + u8path operator/(const u8path& p) const + { + return m_path / p.m_path; + } + + u8path operator/(const std::filesystem::path& p) const + { + return m_path / normalized_separators(p); + } + + u8path operator/(std::string_view str) const + { + return m_path / from_utf8(str); + } + + u8path operator/(std::wstring_view wstr) const + { + return m_path / normalized_separators(wstr); + } + + u8path operator/(const std::string& str) const + { + return m_path / from_utf8(str); + } + + u8path operator/(const std::wstring& wstr) const + { + return m_path / normalized_separators(wstr); + } + + u8path operator/(const char* str) const + { + return m_path / from_utf8(str); + } + + u8path operator/(const wchar_t* wstr) const + { + return m_path / normalized_separators(wstr); + } + + template + u8path& operator/=(T&& some_string) + { + *this = *this / std::forward(some_string); + return *this; + } + + u8path& operator+=(const u8path& to_append) + { + m_path += to_append.m_path; + return *this; + } + + u8path& operator+=(const std::filesystem::path& to_append) + { + m_path += normalized_separators(to_append); + return *this; + } + + u8path& operator+=(std::string_view to_append) + { + m_path = from_utf8(this->string().append(to_append)); + return *this; + } + + u8path& operator+=(std::wstring_view to_append) + { + m_path += normalized_separators(to_append); + return *this; + } + + u8path& operator+=(const char* to_append) + { + m_path = from_utf8(this->string().append(to_append)); + return *this; + } + + u8path& operator+=(const wchar_t* to_append) + { + m_path += normalized_separators(to_append); + return *this; + } + + u8path& operator+=(const std::string& to_append) + { + m_path = from_utf8(this->string().append(to_append)); + return *this; + } + + u8path& operator+=(const std::wstring& to_append) + { + m_path += normalized_separators(to_append); + return *this; + } + + u8path& operator+=(char to_append) + { + m_path = from_utf8(this->string().append(1, to_append)); + return *this; + } + + u8path& operator+=(wchar_t to_append) + { + m_path += to_append; + m_path = normalized_separators(std::move(m_path)); + return *this; + } + + //---- Conversions ---- + + // Returns a UTF-8 string with normalized separators. + std::string string() const + { + return to_utf8(m_path, { /*normalize_sep=*/true }); + } + + // Returns a default encoded string. + decltype(auto) native() const + { + return m_path.native(); + } + + // Returns a UTF-8 string. + operator std::string() const + { + return this->string(); + } + + // Returns the native wstring (UTF-16 on Windows). + std::wstring wstring() const + { + return m_path.wstring(); + } + + // Implicitly convert to native wstring (UTF-16 on Windows). + operator std::wstring() const + { + return this->wstring(); + } + + // Returns a UTF-8 string using the ``/`` on all systems. + std::string generic_string() const + { + return to_utf8(m_path.generic_string(), { /*normalize_sep=*/false }); + } + + // Implicit conversion to standard path. + operator std::filesystem::path() const + { + return m_path; + } + + // Explicit conversion to standard path. + const std::filesystem::path& std_path() const noexcept + { + return m_path; + } + + //---- Parts ---- + + u8path stem() const + { + return m_path.stem(); + } + + u8path parent_path() const + { + return m_path.parent_path(); + } + + u8path root_name() const + { + return m_path.root_name(); + } + + u8path root_directory() const + { + return m_path.root_directory(); + } + + u8path root_path() const + { + return m_path.root_path(); + } + + u8path filename() const + { + return m_path.filename(); + } + + u8path extension() const + { + return m_path.extension(); + } + + u8path lexically_normal() const + { + return m_path.lexically_normal(); + } + + u8path lexically_relative(const u8path& base) const + { + return m_path.lexically_relative(base); + } + + u8path lexically_proximate(const u8path& base) const + { + return m_path.lexically_proximate(base); + } + + //---- Modifiers ---- + + void clear() noexcept + { + m_path.clear(); + } + + u8path& remove_filename() + { + m_path.remove_filename(); + return *this; + } + + u8path& replace_filename(const u8path replacement) + { + m_path.replace_filename(replacement.m_path); + return *this; + } + + u8path& replace_extension(const u8path replacement = u8path()) + { + m_path.replace_extension(replacement.m_path); + return *this; + } + + //---- Operators ---- + friend bool operator==(const u8path& left, const u8path& right) noexcept + { + return left.m_path == right.m_path; + } + + friend std::strong_ordering operator<=>(const u8path& left, const u8path& right) noexcept + { + return left.m_path <=> right.m_path; + } + + friend bool operator==(const u8path& left, const std::filesystem::path& right) noexcept + { + return left.m_path == right; + } + + friend std::strong_ordering + operator<=>(const u8path& left, const std::filesystem::path& right) noexcept + { + return left.m_path <=> right; + } + + friend bool operator==(const u8path& left, const std::string& right) noexcept + { + return left.m_path == from_utf8(right); + } + + friend std::strong_ordering operator<=>(const u8path& left, const std::string& right) noexcept + { + return left.m_path <=> from_utf8(right); + } + + friend bool operator==(const u8path& left, const char* right) noexcept + { + return left.m_path == from_utf8(right); + } + + friend std::strong_ordering operator<=>(const u8path& left, const char* right) noexcept + { + return left.m_path <=> from_utf8(right); + } + + friend bool operator==(const u8path& left, const std::wstring& right) noexcept + { + return left.m_path == std::filesystem::path(right); + } + + friend std::strong_ordering operator<=>(const u8path& left, const std::wstring& right) noexcept + { + return left.m_path <=> std::filesystem::path(right); + } + + friend bool operator==(const u8path& left, const wchar_t* right) noexcept + { + return left.m_path == std::filesystem::path(right); + } + + friend std::strong_ordering operator<=>(const u8path& left, const wchar_t* right) noexcept + { + return left.m_path <=> std::filesystem::path(right); + } + + //---- State ---- + + bool empty() const noexcept + { + return m_path.empty(); + } + + bool is_absolute() const + { + return m_path.is_absolute(); + } + + bool is_relative() const + { + return m_path.is_relative(); + } + + bool has_root_path() const + { + return m_path.has_root_path(); + } + + bool has_root_name() const + { + return m_path.has_root_name(); + } + + bool has_root_directory() const + { + return m_path.has_root_directory(); + } + + bool has_relative_path() const + + { + return m_path.has_relative_path(); + } + + bool has_parent_path() const + { + return m_path.has_parent_path(); + } + + bool has_filename() const + { + return m_path.has_filename(); + } + + bool has_stem() const + { + return m_path.has_stem(); + } + + bool has_extension() const + { + return m_path.has_extension(); + } + + //---- Utility ---- + + // Writing to stream always using UTF-8. + // Note: this will not work well on Windows with std::cout which doesnt know it's UTF-8 + // In that case use `u8path::std_path()` instead. + template + friend OutStream& operator<<(OutStream& out, const u8path& path) + { + out << std::quoted(path.string()); + return out; + } + + // Reads stream assuming UTF-8 encoding. + template + friend InputStream& operator>>(InputStream& in, u8path& path) + { + std::string raw_input; + in >> std::quoted(raw_input); + path.m_path = from_utf8(raw_input); + return in; + } + + friend std::size_t hash_value(const u8path& p) noexcept + { + return hash_value(p.m_path); + } + + friend void swap(u8path& left, u8path& right) noexcept + { + swap(left.m_path, right.m_path); + } + + private: + + std::filesystem::path m_path; + }; + + class directory_entry : private std::filesystem::directory_entry + { + public: + + using std::filesystem::directory_entry::exists; + using std::filesystem::directory_entry::file_size; + using std::filesystem::directory_entry::hard_link_count; + using std::filesystem::directory_entry::is_block_file; + using std::filesystem::directory_entry::is_character_file; + using std::filesystem::directory_entry::is_directory; + using std::filesystem::directory_entry::is_fifo; + using std::filesystem::directory_entry::is_other; + using std::filesystem::directory_entry::is_regular_file; + using std::filesystem::directory_entry::is_socket; + using std::filesystem::directory_entry::is_symlink; + using std::filesystem::directory_entry::last_write_time; + using std::filesystem::directory_entry::status; + using std::filesystem::directory_entry::symlink_status; + + directory_entry() = default; + directory_entry(const directory_entry&) = default; + directory_entry(directory_entry&&) noexcept = default; + directory_entry& operator=(const directory_entry&) = default; + directory_entry& operator=(directory_entry&&) noexcept = default; + + template + explicit directory_entry(const u8path& path, OtherArgs&&... args) + : std::filesystem::directory_entry(path.std_path(), std::forward(args)...) + { + } + + directory_entry(const std::filesystem::directory_entry& other) + : std::filesystem::directory_entry(other) + { + } + + directory_entry(std::filesystem::directory_entry&& other) + : std::filesystem::directory_entry(std::move(other)) + { + } + + directory_entry& operator=(const std::filesystem::directory_entry& other) + { + std::filesystem::directory_entry::operator=(other); + return *this; + } + + directory_entry& operator=(std::filesystem::directory_entry&& other) noexcept + { + std::filesystem::directory_entry::operator=(std::move(other)); + return *this; + } + + std::strong_ordering operator<=>(const directory_entry& other) const noexcept + { + return std::filesystem::directory_entry::operator<=>(other); + } + + u8path path() const + { + return std::filesystem::directory_entry::path(); + } + + operator u8path() const noexcept + { + return std::filesystem::directory_entry::path(); + } + + template + void replace(const u8path p, OtherArgs&&... args) + { + std::filesystem::directory_entry::replace_filename(p, std::forward(args)...); + } + }; + + static_assert(std::is_same_v().path()), u8path>); + + class directory_iterator : private std::filesystem::directory_iterator + { + public: + + using iterator_category = std::input_iterator_tag; + using value_type = directory_entry; + using difference_type = std::ptrdiff_t; + using pointer = const directory_entry*; + using reference = const directory_entry&; + + directory_iterator() = default; + directory_iterator(const directory_iterator&) = default; + directory_iterator(directory_iterator&&) noexcept = default; + directory_iterator& operator=(const directory_iterator&) = default; + directory_iterator& operator=(directory_iterator&&) noexcept = default; + + template + explicit directory_iterator(const u8path& path, OtherArgs&&... args) + : std::filesystem::directory_iterator(path.std_path(), std::forward(args)...) + { + } + + const directory_entry& operator*() const + { + current_entry = std::filesystem::directory_iterator::operator*(); + return current_entry; + } + + const directory_entry* operator->() const + { + return &(**this); + } + + directory_iterator& operator++() + { + std::filesystem::directory_iterator::operator++(); + return *this; + } + + directory_iterator& increment(std::error_code& ec) + { + std::filesystem::directory_iterator::increment(ec); + return *this; + } + + bool operator==(const directory_iterator& other) const noexcept + { + return static_cast(*this) == other; + } + + bool operator!=(const directory_iterator& other) const noexcept + { + return static_cast(*this) != other; + } + + private: + + mutable directory_entry current_entry; + }; + + static_assert(std::is_same_v())>, directory_entry>); + + inline directory_iterator begin(directory_iterator iter) noexcept + { + return iter; + } + + inline directory_iterator end(directory_iterator) noexcept + { + return {}; + } + + class recursive_directory_iterator : private std::filesystem::recursive_directory_iterator + { + public: + + using iterator_category = std::input_iterator_tag; + using value_type = directory_entry; + using difference_type = std::ptrdiff_t; + using pointer = const directory_entry*; + using reference = const directory_entry&; + + using std::filesystem::recursive_directory_iterator::depth; + using std::filesystem::recursive_directory_iterator::disable_recursion_pending; + using std::filesystem::recursive_directory_iterator::options; + using std::filesystem::recursive_directory_iterator::pop; + using std::filesystem::recursive_directory_iterator::recursion_pending; + + recursive_directory_iterator() = default; + recursive_directory_iterator(const recursive_directory_iterator&) = default; + recursive_directory_iterator(recursive_directory_iterator&&) noexcept = default; + recursive_directory_iterator& operator=(const recursive_directory_iterator&) = default; + recursive_directory_iterator& operator=(recursive_directory_iterator&&) noexcept = default; + + template + explicit recursive_directory_iterator(const u8path& path, OtherArgs&&... args) + : std::filesystem::recursive_directory_iterator( + path.std_path(), + std::forward(args)... + ) + { + } + + const directory_entry& operator*() const noexcept + { + current_entry = std::filesystem::recursive_directory_iterator::operator*(); + return current_entry; + } + + const directory_entry* operator->() const noexcept + { + return &(**this); + } + + recursive_directory_iterator& operator++() + { + std::filesystem::recursive_directory_iterator::operator++(); + return *this; + } + + recursive_directory_iterator& increment(std::error_code& ec) + { + std::filesystem::recursive_directory_iterator::increment(ec); + return *this; + } + + bool operator==(const recursive_directory_iterator& other) const noexcept + { + return static_cast(*this) == other; + } + + bool operator!=(const recursive_directory_iterator& other) const noexcept + { + return static_cast(*this) != other; + } + + private: + + mutable directory_entry current_entry; + }; + + static_assert(std::is_same_v())>, directory_entry>); + + inline recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept + { + return iter; + } + + inline recursive_directory_iterator end(recursive_directory_iterator) noexcept + { + return {}; + } + + //---- Standard Filesystem element we reuse here ----- + + using std::filesystem::copy_options; + using std::filesystem::directory_options; + using std::filesystem::file_status; + using std::filesystem::file_time_type; + using std::filesystem::file_type; + using std::filesystem::filesystem_error; + using std::filesystem::perm_options; + using std::filesystem::perms; + using std::filesystem::space_info; + + //----- Wrapped versions of std::filesystem algorithm that returns a `u8path` instead of + //`std::filesystem::path` + + // path absolute(const path& p); + // path absolute(const path& p, error_code& ec); + template + u8path absolute(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::absolute(path, std::forward(args)...); + } + + // path canonical(const path& p); + // path canonical(const path& p, error_code& ec); + template + u8path canonical(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::canonical(path, std::forward(args)...); + } + + // void copy(const path& from, const path& to); + // void copy(const path& from, const path& to, error_code& ec); + // void copy(const path& from, const path& to, copy_options options); + // void copy(const path& from, const path& to, copy_options options, error_code& ec); + template + void copy(const u8path& from, const u8path& to, OtherArgs&&... args) + { + std::filesystem::copy(from, to, std::forward(args)...); + } + + // bool copy_file(const path& from, const path& to); + // bool copy_file(const path& from, const path& to, error_code& ec); + // bool copy_file(const path& from, const path& to, copy_options option); + // bool copy_file(const path& from, const path& to, copy_options option, error_code& ec); + template + bool copy_file(const u8path& from, const u8path& to, OtherArgs&&... args) + { + return std::filesystem::copy_file(from, to, std::forward(args)...); + } + + // void copy_symlink(const path& existing_symlink, const path& new_symlink); + // void copy_symlink(const path& existing_symlink, + // const path& new_symlink, + // error_code& ec) noexcept; + template + void copy_symlink(const u8path& existing_symlink, const u8path& new_symlink, OtherArgs&&... args) + { + std::filesystem::copy_symlink(existing_symlink, new_symlink, std::forward(args)...); + } + + // bool create_directories(const path& p); + // bool create_directories(const path& p, error_code& ec); + template + bool create_directories(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::create_directories(path, std::forward(args)...); + } + + // bool create_directory(const path& p); + // bool create_directory(const path& p, error_code& ec) noexcept; + template + bool create_directory(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::create_directory(path, std::forward(args)...); + } + + // bool create_directory(const path& p, const path& attributes); + // bool create_directory(const path& p, const path& attributes, error_code& ec) noexcept; + template + bool create_directory(const u8path& path, const u8path& attributes, OtherArgs&&... args) + { + return std::filesystem::create_directory(path, attributes, std::forward(args)...); + } + + // void create_directory_symlink(const path& to, const path& new_symlink); + // void create_directory_symlink(const path& to, const path& new_symlink, error_code& ec) + // noexcept; + template + void create_directory_symlink(const u8path& to, const u8path& new_symlink, OtherArgs&&... args) + { + std::filesystem::create_directory_symlink(to, new_symlink, std::forward(args)...); + } + + // void create_hard_link(const path& to, const path& new_hard_link); + // void create_hard_link(const path& to, const path& new_hard_link, error_code& ec) noexcept; + template + void create_hard_link(const u8path& to, const u8path& new_hard_link, OtherArgs&&... args) + { + std::filesystem::create_hard_link(to, new_hard_link, std::forward(args)...); + } + + // void create_symlink(const path& to, const path& new_symlink); + // void create_symlink(const path& to, const path& new_symlink, error_code& ec) noexcept; + template + void create_symlink(const u8path& to, const u8path& new_symlink, OtherArgs&&... args) + { + std::filesystem::create_symlink(to, new_symlink, std::forward(args)...); + } + + // path current_path(); + inline u8path current_path() + { + return std::filesystem::current_path(); + } + + // path current_path(error_code& ec); + inline u8path current_path(std::error_code& ec) + { + return std::filesystem::current_path(ec); + } + + // void current_path(const path& p); + // void current_path(const path& p, error_code& ec) noexcept; + template + void current_path(const u8path& path, OtherArgs&&... args) + { + std::filesystem::current_path(path, std::forward(args)...); + } + + // bool equivalent(const path& p1, const path& p2); + // bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; + template + bool equivalent(const u8path& p1, const u8path& p2, OtherArgs&&... args) + { + return std::filesystem::equivalent(p1, p2, std::forward(args)...); + } + + // bool exists(file_status s) noexcept; + inline bool exists(file_status s) noexcept + { + return std::filesystem::exists(s); + } + + // bool exists(const path& p); + // bool exists(const path& p, error_code& ec) noexcept; + template + bool exists(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::exists(path, std::forward(args)...); + } + + // uintmax_t file_size(const path& p); + // uintmax_t file_size(const path& p, error_code& ec) noexcept; + template + uintmax_t file_size(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::file_size(path, std::forward(args)...); + } + + // uintmax_t hard_link_count(const path& p); + // uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; + template + uintmax_t hard_link_count(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::hard_link_count(path, std::forward(args)...); + } + + // bool is_block_file(file_status s) noexcept; + inline bool is_block_file(file_status s) noexcept + { + return std::filesystem::is_block_file(s); + } + + // bool is_block_file(const path& p); + // bool is_block_file(const path& p, error_code& ec) noexcept; + template + bool is_block_file(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_block_file(path, std::forward(args)...); + } + + // bool is_character_file(file_status s) noexcept; + inline bool is_character_file(file_status s) noexcept + { + return std::filesystem::is_character_file(s); + } + + // bool is_character_file(const path& p); + // bool is_character_file(const path& p, error_code& ec) noexcept; + template + bool is_character_file(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_character_file(path, std::forward(args)...); + } + + // bool is_directory(file_status s) noexcept; + inline bool is_directory(file_status s) noexcept + { + return std::filesystem::is_directory(s); + } + + // bool is_directory(const path& p); + // bool is_directory(const path& p, error_code& ec) noexcept; + template + bool is_directory(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_directory(path, std::forward(args)...); + } + + // bool is_empty(const path& p); + // bool is_empty(const path& p, error_code& ec); + template + bool is_empty(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_empty(path, std::forward(args)...); + } + + // bool is_fifo(file_status s) noexcept; + inline bool is_fifo(file_status s) noexcept + { + return std::filesystem::is_fifo(s); + } + + // bool is_fifo(const path& p); + // bool is_fifo(const path& p, error_code& ec) noexcept; + template + bool is_fifo(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_fifo(path, std::forward(args)...); + } + + // bool is_other(file_status s) noexcept; + inline bool is_other(file_status s) noexcept + { + return std::filesystem::is_other(s); + } + + // bool is_other(const path& p); + // bool is_other(const path& p, error_code& ec) noexcept; + template + bool is_other(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_other(path, std::forward(args)...); + } + + // bool is_regular_file(file_status s) noexcept; + inline bool is_regular_file(file_status s) noexcept + { + return std::filesystem::is_regular_file(s); + } + + // bool is_regular_file(const path& p); + // bool is_regular_file(const path& p, error_code& ec) noexcept; + template + bool is_regular_file(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_regular_file(path, std::forward(args)...); + } + + // bool is_socket(file_status s) noexcept; + inline bool is_socket(file_status s) noexcept + { + return std::filesystem::is_socket(s); + } + + // bool is_socket(const path& p); + // bool is_socket(const path& p, error_code& ec) noexcept; + template + bool is_socket(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_socket(path, std::forward(args)...); + } + + // bool is_symlink(file_status s) noexcept; + inline bool is_symlink(file_status s) noexcept + { + return std::filesystem::is_symlink(s); + } + + // bool is_symlink(const path& p); + // bool is_symlink(const path& p, error_code& ec) noexcept; + template + bool is_symlink(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::is_symlink(path, std::forward(args)...); + } + + // file_time_type last_write_time(const path& p); + // file_time_type last_write_time(const path& p, error_code& ec) noexcept; + template + file_time_type last_write_time(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::last_write_time(path, std::forward(args)...); + } + + // void last_write_time(const path& p, now _, error_code& ec) noexcept; + void last_write_time(const u8path& path, now, std::error_code& ec) noexcept; + + // void last_write_time(const path& p, now _); + inline void last_write_time(const u8path& path, now sentinel) + { + std::error_code ec; + last_write_time(path, sentinel, ec); + if (ec) + { + throw filesystem_error("last_write_time", path, ec); + } + } + + // void last_write_time(const path& p, file_time_type new_time); + // void last_write_time(const path& p, file_time_type new_time, error_code& ec) noexcept; + template + void last_write_time(const u8path& path, file_time_type new_time, OtherArgs&&... args) + { + return std::filesystem::last_write_time(path, new_time, std::forward(args)...); + } + + // void permissions(const path& p, perms prms, perm_options opts = perm_options::replace); + // void permissions(const path& p, perms prms, error_code& ec) noexcept; + // void permissions(const path& p, perms prms, perm_options opts, error_code& ec); + template + void permissions(const u8path& path, OtherArgs&&... args) + { + std::filesystem::permissions(path, std::forward(args)...); + } + + // path proximate(const path& p, error_code& ec); + // path proximate(const path& p, const path& base = current_path()); + template + u8path proximate(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::proximate(path, std::forward(args)...); + } + + // path proximate(const path& p, const path& base, error_code& ec); + template + u8path proximate(const u8path& path, const u8path& base, OtherArgs&&... args) + { + return std::filesystem::proximate(path, base, std::forward(args)...); + } + + // path read_symlink(const path& p); + // path read_symlink(const path& p, error_code& ec); + template + u8path read_symlink(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::read_symlink(path, std::forward(args)...); + } + + // path relative(const path& p, error_code& ec); + // path relative(const path& p, const path& base = current_path()); + template + u8path relative(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::relative(path, std::forward(args)...); + } + + // path relative(const path& p, const path& base, error_code& ec); + template + u8path relative(const u8path& path, const u8path& base, OtherArgs&&... args) + { + return std::filesystem::relative(path, base, std::forward(args)...); + } + + // bool remove(const path& p); + // bool remove(const path& p, error_code& ec) noexcept; + template + bool remove(const u8path& path, OtherArgs&&... args) + { +#if defined(WIN32) && _MSC_VER < 1930 // Workaround https://github.com/microsoft/STL/issues/1511 + std::error_code errc; + const auto file_status = std::filesystem::status(path, errc); + if (!errc + && (file_status.permissions() & std::filesystem::perms::owner_read) + != std::filesystem::perms::none + && (file_status.permissions() & std::filesystem::perms::owner_write) + == std::filesystem::perms::none) + { + // The target file is read-only, we need to change that to fix the + // VS bug. + fs::permissions(path, fs::perms::owner_write, fs::perm_options::add); + } +#endif + return std::filesystem::remove(path, std::forward(args)...); + } + + // uintmax_t remove_all(const path& p); + // uintmax_t remove_all(const path& p, error_code& ec); + template + uintmax_t remove_all(const u8path& path, OtherArgs&&... args) + { +#if defined(WIN32) && _MSC_VER < 1930 // Workaround https://github.com/microsoft/STL/issues/1511 + if (!fs::exists(path)) + { + return 0; + } + + uintmax_t counter = 0; + for (const auto& entry : fs::recursive_directory_iterator(path, args...)) + { + if (fs::is_directory(entry.path())) + { // Skip directories, we'll delete them later. + continue; + } + + if (fs::remove(entry.path(), args...)) + { + ++counter; + } + else + { + break; + } + } + + // Now remove all the directories resting. + counter += std::filesystem::remove_all(path, args...); + + return counter; +#else + return std::filesystem::remove_all(path, std::forward(args)...); +#endif + } + + // void rename(const path& from, const path& to); + // void rename(const path& from, const path& to, error_code& ec) noexcept; + template + void rename(const u8path& from, const u8path& to, OtherArgs&&... args) + { + std::filesystem::rename(from, to, std::forward(args)...); + } + + // void resize_file(const path& p, uintmax_t size); + // void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept; + template + void resize_file(const u8path& path, OtherArgs&&... args) + { + std::filesystem::resize_file(path, std::forward(args)...); + } + + // space_info space(const path& p); + // space_info space(const path& p, error_code& ec) noexcept; + template + space_info space(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::space(path, std::forward(args)...); + } + + // file_status status(const path& p); + // file_status status(const path& p, error_code& ec) noexcept; + template + file_status status(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::status(path, std::forward(args)...); + } + + // bool status_known(file_status s) noexcept; + inline bool status_known(file_status s) noexcept + { + return std::filesystem::status_known(s); + } + + // file_status symlink_status(const path& p); + // file_status symlink_status(const path& p, error_code& ec) noexcept; + template + file_status symlink_status(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::symlink_status(path, std::forward(args)...); + } + + // path temp_directory_path(); + // path temp_directory_path(error_code& ec); + template + u8path temp_directory_path(OtherArgs&&... args) + { + return std::filesystem::temp_directory_path(std::forward(args)...); + } + + // path weakly_canonical(const path& p); + // path weakly_canonical(const path& p, error_code& ec); + template + u8path weakly_canonical(const u8path& path, OtherArgs&&... args) + { + return std::filesystem::weakly_canonical(path, std::forward(args)...); + } + +} + +template <> +struct std::hash<::mamba::fs::u8path> +{ + std::size_t operator()(const ::mamba::fs::u8path& path) const noexcept + { + return std::filesystem::hash_value(path.std_path() + ); // TODO: once we stop using gcc < 12 we can properly use + // std::hash{}(path.std_path()); + } +}; + +template <> +struct fmt::formatter<::mamba::fs::u8path> +{ + constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw format_error("invalid format"); + } + return ctx.begin(); + } + + template + auto format(const ::mamba::fs::u8path& path, FormatContext& ctx) const + { + return fmt::format_to(ctx.out(), "'{}'", path.string()); + } +}; +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/database.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/database.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3d6cb2babbc99662692caba921f000adc9a05089 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/database.hpp @@ -0,0 +1,270 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_LIBSOLV_DATABASE_HPP +#define MAMBA_SOLVER_LIBSOLV_DATABASE_HPP + +#include +#include +#include +#include + +#include "mamba/core/error_handling.hpp" +#include "mamba/solver/libsolv/parameters.hpp" +#include "mamba/solver/libsolv/repo_info.hpp" +#include "mamba/specs/channel.hpp" +#include "mamba/specs/package_info.hpp" +#include "mamba/util/loop_control.hpp" + +namespace solv +{ + class ObjPool; +} + +namespace mamba +{ + namespace fs + { + class u8path; + } + + namespace specs + { + class MatchSpec; + } +} + +namespace mamba::solver::libsolv +{ + class Solver; + class UnSolvable; + + /** + * Database of solvable involved in resolving en environment. + * + * The database contains the solvable (packages) information required from the @ref Solver. + * The database can be reused by multiple solvers to solve different requirements with the + * same ecosystem. + */ + class Database + { + public: + + /** + * Global Database settings. + */ + struct Settings + { + MatchSpecParser matchspec_parser = MatchSpecParser::Libsolv; + }; + + using logger_type = std::function; + + explicit Database(specs::ChannelResolveParams channel_params); + Database(specs::ChannelResolveParams channel_params, Settings settings); + Database(const Database&) = delete; + Database(Database&&); + + ~Database(); + + auto operator=(const Database&) -> Database& = delete; + auto operator=(Database&&) -> Database&; + + [[nodiscard]] auto channel_params() const -> const specs::ChannelResolveParams&; + + [[nodiscard]] auto settings() const -> const Settings&; + + void set_logger(logger_type callback); + + auto add_repo_from_repodata_json( + const fs::u8path& path, + std::string_view url, + const std::string& channel_id, + PipAsPythonDependency add = PipAsPythonDependency::No, + PackageTypes package_types = PackageTypes::CondaOrElseTarBz2, + VerifyPackages verify_packages = VerifyPackages::No, + RepodataParser repo_parser = RepodataParser::Mamba + ) -> expected_t; + + auto add_repo_from_native_serialization( + const fs::u8path& path, + const RepodataOrigin& expected, + const std::string& channel_id, + PipAsPythonDependency add = PipAsPythonDependency::No + ) -> expected_t; + + template + auto add_repo_from_packages( + Iter first_package, + Iter last_package, + std::string_view name = "", + PipAsPythonDependency add = PipAsPythonDependency::No + ) -> RepoInfo; + + template + auto add_repo_from_packages( + const Range& packages, + std::string_view name = "", + PipAsPythonDependency add = PipAsPythonDependency::No + ) -> RepoInfo; + + auto + native_serialize_repo(const RepoInfo& repo, const fs::u8path& path, const RepodataOrigin& metadata) + -> expected_t; + + [[nodiscard]] auto installed_repo() const -> std::optional; + + void set_installed_repo(RepoInfo repo); + + void set_repo_priority(RepoInfo repo, Priorities priorities); + + void remove_repo(RepoInfo repo); + + [[nodiscard]] auto repo_count() const -> std::size_t; + + [[nodiscard]] auto package_count() const -> std::size_t; + + template + void for_each_package_in_repo(RepoInfo repo, Func&&) const; + + template + void for_each_package_matching(const specs::MatchSpec& ms, Func&&); + + template + void for_each_package_depending_on(const specs::MatchSpec& ms, Func&&); + + /** + * An access control wrapper. + * + * This struct is to control who can access the underlying private representation + * of the ObjPool without giving them full friend access. + */ + class Impl + { + [[nodiscard]] static auto get(Database& database) -> solv::ObjPool&; + [[nodiscard]] static auto get(const Database& database) -> const solv::ObjPool&; + + friend class Solver; + friend class UnSolvable; + }; + + private: + + struct DatabaseImpl; + + std::unique_ptr m_data; + + friend class Impl; + auto pool() -> solv::ObjPool&; + [[nodiscard]] auto pool() const -> const solv::ObjPool&; + + auto add_repo_from_packages_impl_pre(std::string_view name) -> RepoInfo; + void add_repo_from_packages_impl_loop(const RepoInfo& repo, const specs::PackageInfo& pkg); + void add_repo_from_packages_impl_post(const RepoInfo& repo, PipAsPythonDependency add); + + enum class PackageId : int; + + [[nodiscard]] auto package_id_to_package_info(PackageId id) const -> specs::PackageInfo; + + [[nodiscard]] auto packages_in_repo(RepoInfo repo) const -> std::vector; + + [[nodiscard]] auto packages_matching_ids(const specs::MatchSpec& ms) + -> std::vector; + + [[nodiscard]] auto packages_depending_on_ids(const specs::MatchSpec& ms) + -> std::vector; + }; + + /******************** + * Implementation * + ********************/ + + template + auto Database::add_repo_from_packages( + Iter first_package, + Iter last_package, + std::string_view name, + PipAsPythonDependency add + ) -> RepoInfo + { + auto repo = add_repo_from_packages_impl_pre(name); + for (; first_package != last_package; ++first_package) + { + add_repo_from_packages_impl_loop(repo, *first_package); + } + add_repo_from_packages_impl_post(repo, add); + return repo; + } + + template + auto + Database::add_repo_from_packages(const Range& packages, std::string_view name, PipAsPythonDependency add) + -> RepoInfo + { + return add_repo_from_packages(packages.begin(), packages.end(), name, add); + } + + // TODO(C++20): Use ranges::transform + template + void Database::for_each_package_in_repo(RepoInfo repo, Func&& func) const + { + for (auto id : packages_in_repo(repo)) + { + if constexpr (std::is_same_v) + { + if (func(package_id_to_package_info(id)) == util::LoopControl::Break) + { + break; + } + } + else + { + func(package_id_to_package_info(id)); + } + } + } + + // TODO(C++20): Use ranges::transform + template + void Database::for_each_package_matching(const specs::MatchSpec& ms, Func&& func) + { + for (auto id : packages_matching_ids(ms)) + { + if constexpr (std::is_same_v) + { + if (func(package_id_to_package_info(id)) == util::LoopControl::Break) + { + break; + } + } + else + { + func(package_id_to_package_info(id)); + } + } + } + + // TODO(C++20): Use ranges::transform + template + void Database::for_each_package_depending_on(const specs::MatchSpec& ms, Func&& func) + { + for (auto id : packages_depending_on_ids(ms)) + { + if constexpr (std::is_same_v) + { + if (func(package_id_to_package_info(id)) == util::LoopControl::Break) + { + break; + } + } + else + { + func(package_id_to_package_info(id)); + } + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/parameters.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/parameters.hpp new file mode 100644 index 0000000000000000000000000000000000000000..01dfdd392291d05bce11c15c441d1a4ce3cdc4d5 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/parameters.hpp @@ -0,0 +1,87 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_LIBSOLV_PARAMETERS_HPP +#define MAMBA_SOLVER_LIBSOLV_PARAMETERS_HPP + +#include + +#include + +namespace mamba::solver::libsolv +{ + enum class RepodataParser + { + Mamba, + Libsolv, + }; + + enum class MatchSpecParser + { + Mixed, + Mamba, + Libsolv, + }; + + enum class PipAsPythonDependency : bool + { + No = false, + Yes = true, + }; + + enum class PackageTypes + { + CondaOnly, + TarBz2Only, + CondaAndTarBz2, + CondaOrElseTarBz2, + }; + + enum class VerifyPackages : bool + { + No = false, + Yes = true, + }; + + enum class LogLevel + { + Debug, + Warning, + Error, + Fatal, + }; + + struct Priorities + { + using value_type = int; + + value_type priority = 0; + value_type subpriority = 0; + }; + + [[nodiscard]] auto operator==(const Priorities& lhs, const Priorities& rhs) -> bool; + [[nodiscard]] auto operator!=(const Priorities& lhs, const Priorities& rhs) -> bool; + + /** + * Metadata serialized with a repository index. + * + * This is used to identify if the binary serialization is out of date with the expected + * index. + */ + struct RepodataOrigin + { + std::string url = {}; + std::string etag = {}; + std::string mod = {}; + }; + + auto operator==(const RepodataOrigin& lhs, const RepodataOrigin& rhs) -> bool; + auto operator!=(const RepodataOrigin& lhs, const RepodataOrigin& rhs) -> bool; + + void to_json(nlohmann::json& j, const RepodataOrigin& m); + void from_json(const nlohmann::json& j, RepodataOrigin& p); +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/repo_info.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/repo_info.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e0c0d313a31613e8c810149e1af6791f99e7b25d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/repo_info.hpp @@ -0,0 +1,68 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_LIBSOLV_REPO_INFO_HPP +#define MAMBA_SOLVER_LIBSOLV_REPO_INFO_HPP + +#include + +#include "mamba/solver/libsolv/parameters.hpp" + + +extern "C" +{ + using Repo = struct s_Repo; +} + +namespace mamba::solver::libsolv +{ + class Database; + + /** + * A libsolv repository descriptor. + * + * In libsolv, most of the data is help in the @ref Database, and repo are tightly coupled + * with them. + * This repository class is a lightweight description of a repository returned when creating + * a new repository in the @ref Database. + * Some modifications to the repo are possible through the @ref Database. + * @see Database::add_repo_from_repodata_json + * @see Database::add_repo_from_packages + * @see Database::remove_repo + */ + class RepoInfo + { + public: + + using RepoId = int; + + RepoInfo(const RepoInfo&) = default; + RepoInfo(RepoInfo&&) = default; + auto operator=(const RepoInfo&) -> RepoInfo& = default; + auto operator=(RepoInfo&&) -> RepoInfo& = default; + + [[nodiscard]] auto id() const -> RepoId; + + [[nodiscard]] auto name() const -> std::string_view; + + [[nodiscard]] auto package_count() const -> std::size_t; + + [[nodiscard]] auto priority() const -> Priorities; + + private: + + ::Repo* m_ptr = nullptr; // This is a view managed by libsolv pool + + explicit RepoInfo(::Repo* repo); + + friend class Database; + friend auto operator==(RepoInfo lhs, RepoInfo rhs) -> bool; + }; + + auto operator==(RepoInfo lhs, RepoInfo rhs) -> bool; + auto operator!=(RepoInfo lhs, RepoInfo rhs) -> bool; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/solver.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/solver.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4057a8418257939c3dbc8fb45f1a9e3c4a42bbc4 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/solver.hpp @@ -0,0 +1,40 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_LIBSOLV_SOLVER_HPP +#define MAMBA_SOLVER_LIBSOLV_SOLVER_HPP + +#include "mamba/core/error_handling.hpp" +#include "mamba/solver/libsolv/parameters.hpp" +#include "mamba/solver/libsolv/unsolvable.hpp" +#include "mamba/solver/request.hpp" +#include "mamba/solver/solution.hpp" + +namespace mamba::solver::libsolv +{ + class Database; + + class Solver + { + public: + + using Outcome = std::variant; + + [[nodiscard]] auto + solve(Database& database, Request&& request, MatchSpecParser ms_parser = MatchSpecParser::Mixed) + -> expected_t; + + [[nodiscard]] auto + solve(Database& database, const Request& request, MatchSpecParser ms_parser = MatchSpecParser::Mixed) + -> expected_t; + + private: + + auto solve_impl(Database& database, const Request& request, MatchSpecParser ms_parser) + -> expected_t; + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/unsolvable.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/unsolvable.hpp new file mode 100644 index 0000000000000000000000000000000000000000..998fa32bbb83b62955fd8c758fdf046cb875f358 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/libsolv/unsolvable.hpp @@ -0,0 +1,74 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_LIBSOLV_UNSOLVABLE_HPP +#define MAMBA_SOLVER_LIBSOLV_UNSOLVABLE_HPP + +#include +#include +#include +#include + +#include "mamba/solver/problems_graph.hpp" + +namespace solv +{ + class ObjSolver; +} + +namespace mamba +{ + struct Palette; +} + +namespace mamba::solver::libsolv +{ + class Solver; + class Database; + + class UnSolvable + { + public: + + UnSolvable(UnSolvable&&); + + ~UnSolvable(); + + auto operator=(UnSolvable&&) -> UnSolvable&; + + [[nodiscard]] auto problems(Database& database) const -> std::vector; + + [[nodiscard]] auto problems_to_str(Database& database) const -> std::string; + + [[nodiscard]] auto all_problems_to_str(Database& database) const -> std::string; + + [[nodiscard]] auto problems_graph(const Database& database) const -> ProblemsGraph; + + auto explain_problems_to( // + Database& database, + std::ostream& out, + const ProblemsMessageFormat& format + ) const -> std::ostream&; + + [[nodiscard]] auto + explain_problems(Database& database, const ProblemsMessageFormat& format) const + -> std::string; + + private: + + // Pimpl all libsolv to keep it private + // We could make it a reference if we consider it is worth keeping the data in the Solver + // for potential resolve. + std::unique_ptr m_solver; + + explicit UnSolvable(std::unique_ptr&& solver); + + [[nodiscard]] auto solver() const -> const solv::ObjSolver&; + + friend class Solver; + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/problems_graph.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/problems_graph.hpp new file mode 100644 index 0000000000000000000000000000000000000000..21165605ff79e2c93acac27058db7125aad2104c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/problems_graph.hpp @@ -0,0 +1,403 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_PROBLEMS_GRAPH_HPP +#define MAMBA_PROBLEMS_GRAPH_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "mamba/specs/match_spec.hpp" +#include "mamba/specs/package_info.hpp" +#include "mamba/util/flat_set.hpp" +#include "mamba/util/graph.hpp" + +namespace mamba::solver +{ + namespace libsolv + { + class Database; + } + + template + class conflict_map : private std::unordered_map> + { + public: + + using Base = std::unordered_map>; + using typename Base::const_iterator; + using typename Base::key_type; + using typename Base::value_type; + + conflict_map() = default; + conflict_map(std::initializer_list> conflicts_pairs); + + using Base::empty; + using Base::size; + [[nodiscard]] auto has_conflict(const key_type& a) const -> bool; + [[nodiscard]] auto conflicts(const key_type& a) const -> const util::flat_set&; + [[nodiscard]] auto in_conflict(const key_type& a, const key_type& b) const -> bool; + + using Base::cbegin; + using Base::cend; + auto begin() const noexcept -> const_iterator; + auto end() const noexcept -> const_iterator; + + using Base::clear; + auto add(const key_type& a, const key_type& b) -> bool; + auto remove(const key_type& a, const key_type& b) -> bool; + auto remove(const key_type& a) -> bool; + + private: + + auto base() const -> const Base&; + + auto remove_asym(const key_type& a, const key_type& b) -> bool; + + template + friend auto operator==(const conflict_map& lhs, const conflict_map& rhs) -> bool; + template + friend auto operator!=(const conflict_map& lhs, const conflict_map& rhs) -> bool; + }; + + template + auto operator==(const conflict_map& lhs, const conflict_map& rhs) -> bool; + + template + auto operator!=(const conflict_map& lhs, const conflict_map& rhs) -> bool; + + /** + * A directed graph of the packages involved in a libsolv conflict. + */ + class ProblemsGraph + { + public: + + struct RootNode + { + }; + + struct PackageNode : specs::PackageInfo + { + }; + + struct UnresolvedDependencyNode : specs::MatchSpec + { + }; + + struct ConstraintNode : specs::MatchSpec + { + }; + + using node_t = std::variant; + + using edge_t = specs::MatchSpec; + + using graph_t = util::DiGraph; + using node_id = graph_t::node_id; + using conflicts_t = conflict_map; + + ProblemsGraph(graph_t graph, conflicts_t conflicts, node_id root_node); + + [[nodiscard]] auto graph() const noexcept -> const graph_t&; + [[nodiscard]] auto conflicts() const noexcept -> const conflicts_t&; + [[nodiscard]] auto root_node() const noexcept -> node_id; + + private: + + graph_t m_graph; + conflicts_t m_conflicts; + node_id m_root_node; + }; + + /** + * Hand-crafted hurisitics to simplify conflicts in messy situations. + */ + auto simplify_conflicts(const ProblemsGraph& pbs) -> ProblemsGraph; + + class CompressedProblemsGraph + { + public: + + using RootNode = ProblemsGraph::RootNode; + + /** + * A rough comparison for nodes. + * + * We need to be able to compare nodes for using them in a set but we do not have + * proper version parsing. + * Ideally we would like proper comparison for printing packages in order. + * + * As with ``NamedList`` below, the implementation is currently kept private for + * needed types. + */ + template + struct RoughCompare + { + auto operator()(const T& a, const T& b) const -> bool; + }; + + /** + * A list of objects with a name, version, and build member. + * + * For simplicity, the implementation is kept in the translation unit with + * specialization for needed types. + */ + template > + class NamedList : private util::flat_set, Allocator> + { + public: + + using Base = util::flat_set, Allocator>; + using typename Base::allocator_type; + using typename Base::const_iterator; + using typename Base::const_reverse_iterator; + using typename Base::value_type; + + NamedList() = default; + template + NamedList(InputIterator first, InputIterator last); + + using Base::empty; + using Base::size; + auto front() const noexcept -> const value_type&; + auto back() const noexcept -> const value_type&; + using Base::cbegin; + using Base::cend; + using Base::crbegin; + using Base::crend; + auto begin() const noexcept -> const_iterator; + auto end() const noexcept -> const_iterator; + auto rbegin() const noexcept -> const_reverse_iterator; + auto rend() const noexcept -> const_reverse_iterator; + + [[nodiscard]] auto name() const -> const std::string&; + [[nodiscard]] auto versions_trunc( + std::string_view sep = "|", + std::string_view etc = "...", + std::size_t threshold = 5, + bool remove_duplicates = true + ) const -> std::pair; + [[nodiscard]] auto build_strings_trunc( + std::string_view sep = "|", + std::string_view etc = "...", + std::size_t threshold = 5, + bool remove_duplicates = true + ) const -> std::pair; + [[nodiscard]] auto versions_and_build_strings_trunc( + std::string_view sep = "|", + std::string_view etc = "...", + std::size_t threshold = 5, + bool remove_duplicates = true + ) const -> std::pair; + + using Base::clear; + using Base::reserve; + void insert(const value_type& e); + void insert(value_type&& e); + template + void insert(InputIterator first, InputIterator last); + + private: + + template + void insert_impl(T_&& e); + }; + + using PackageListNode = NamedList; + using UnresolvedDependencyListNode = NamedList; + using ConstraintListNode = NamedList; + using node_t = std::variant< + RootNode, // + PackageListNode, + UnresolvedDependencyListNode, + ConstraintListNode>; + + using edge_t = NamedList; + + using graph_t = util::DiGraph; + using node_id = graph_t::node_id; + using conflicts_t = conflict_map; + + using merge_criteria_t = std::function< + bool(const ProblemsGraph&, ProblemsGraph::node_id, ProblemsGraph::node_id)>; + + static auto + from_problems_graph(const ProblemsGraph& pbs, const merge_criteria_t& merge_criteria = {}) + -> CompressedProblemsGraph; + + CompressedProblemsGraph(graph_t graph, conflicts_t conflicts, node_id root_node); + + [[nodiscard]] auto graph() const noexcept -> const graph_t&; + [[nodiscard]] auto conflicts() const noexcept -> const conflicts_t&; + [[nodiscard]] auto root_node() const noexcept -> node_id; + + private: + + graph_t m_graph; + conflicts_t m_conflicts; + node_id m_root_node; + }; + + /** + * Formatting options for error message functions. + */ + struct ProblemsMessageFormat + { + fmt::text_style unavailable = fmt::fg(fmt::terminal_color::red); + fmt::text_style available = fmt::fg(fmt::terminal_color::green); + std::array indents = { "│ ", " ", "├─ ", "└─ " }; + }; + + auto print_problem_tree_msg( + std::ostream& out, + const CompressedProblemsGraph& pbs, + const ProblemsMessageFormat& format = {} + ) -> std::ostream&; + + auto problem_tree_msg( // + const CompressedProblemsGraph& pbs, + const ProblemsMessageFormat& format = {} + ) -> std::string; + + /************************************ + * Implementation of conflict_map * + ************************************/ + + template + conflict_map::conflict_map(std::initializer_list> conflicts_pairs) + { + for (const auto& [a, b] : conflicts_pairs) + { + add(a, b); + } + } + + template + auto conflict_map::has_conflict(const key_type& a) const -> bool + { + return Base::find(a) != end(); + } + + template + auto conflict_map::conflicts(const key_type& a) const -> const util::flat_set& + { + return Base::at(a); + } + + template + auto conflict_map::in_conflict(const key_type& a, const key_type& b) const -> bool + { + return has_conflict(a) && Base::at(a).contains(b); + } + + template + auto conflict_map::begin() const noexcept -> const_iterator + { + return Base::begin(); + } + + template + auto conflict_map::end() const noexcept -> const_iterator + { + return Base::end(); + } + + template + auto conflict_map::add(const key_type& a, const key_type& b) -> bool + { + auto [_, inserted] = Base::operator[](a).insert(b); + if (a != b) + { + Base::operator[](b).insert(a); + } + return inserted; + } + + template + auto conflict_map::base() const -> const Base& + { + return static_cast(*this); + } + + template + auto conflict_map::remove_asym(const key_type& a, const key_type& b) -> bool + { + auto iter = Base::find(a); + if (iter == Base::end()) + { + return false; + } + auto& cflcts = iter->second; + const bool erased = cflcts.erase(b); + if (cflcts.empty()) + { + Base::erase(a); + } + return erased; + }; + + template + auto conflict_map::remove(const key_type& a, const key_type& b) -> bool + { + return remove_asym(a, b) && ((a == b) || remove_asym(b, a)); + } + + template + auto conflict_map::remove(const key_type& a) -> bool + { + auto a_iter = Base::find(a); + if (a_iter == Base::end()) + { + return false; + } + for (const auto& b : a_iter->second) + { + if (a != b) // Cannot modify while we iterate on it + { + remove_asym(b, a); + } + } + Base::erase(a); + return true; + } + + template + auto operator==(const conflict_map& lhs, const conflict_map& rhs) -> bool + { + return lhs.base() == rhs.base(); + } + + template + auto operator!=(const conflict_map& lhs, const conflict_map& rhs) -> bool + { + return !(lhs == rhs); + } + + /********************************* + * Implementation of NamedList * + *********************************/ + + template + template + void CompressedProblemsGraph::NamedList::insert(InputIterator first, InputIterator last) + { + for (; first < last; ++first) + { + insert(*first); + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/request.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/request.hpp new file mode 100644 index 0000000000000000000000000000000000000000..50f3a2b906bbeacee45c827cc31b5e5e3b1305e5 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/request.hpp @@ -0,0 +1,125 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SOLVER_REQUEST_HPP +#define MAMBA_SOLVER_REQUEST_HPP + +#include +#include + +#include "mamba/specs/match_spec.hpp" +#include "mamba/util/loop_control.hpp" +#include "mamba/util/type_traits.hpp" + +namespace mamba::solver +{ + struct Request + { + struct Flags + { + /** Keep the dependencies of the install package in the solution. */ + bool keep_dependencies = true; + /** Keep the original user requested package in the solution. */ + bool keep_user_specs = true; + /** Force reinstallation of jobs. */ + bool force_reinstall = false; + /** Allow downgrading packages to satisfy requirements. */ + bool allow_downgrade = true; + /** Allow uninstalling packages to satisfy requirements. */ + bool allow_uninstall = true; + /** Prefer packages by repoitory order. */ + bool strict_repo_priority = true; + /** Order the request to get a deterministic solution. */ + bool order_request = true; + }; + + /** Instruct to install a package matching the given spec. */ + struct Install + { + specs::MatchSpec spec; + }; + + /** Instruct to remove packages matching the given spec. */ + struct Remove + { + specs::MatchSpec spec; + bool clean_dependencies = true; + }; + + /** Instruct to update packages matching the given spec. */ + struct Update + { + specs::MatchSpec spec; + bool clean_dependencies = true; + }; + + /** Instruct to update all installed packages. */ + struct UpdateAll + { + bool clean_dependencies = true; + }; + + /** Instruct to keep packages matching the spec during dependency clean. */ + struct Keep + { + specs::MatchSpec spec; + }; + + /** Instruct to freeze the version and status of the matching installed package. */ + struct Freeze + { + specs::MatchSpec spec; + }; + + /** Add a constraints on packages possible to install. */ + struct Pin + { + specs::MatchSpec spec; + }; + + using Job = std::variant; + using job_list = std::vector; + + Flags flags = {}; + job_list jobs = {}; + }; + + template + void for_each_of(const Request& request, Func&& func) + { + for (const auto& unknown_job : request.jobs) + { + const auto control = std::visit( + [&](const auto& itm) -> util::LoopControl + { + using Itm = std::decay_t; + if constexpr (util::is_any_of_v) + { + if constexpr (std::is_same_v) + { + return func(itm); + } + else + { + func(itm); + return util::LoopControl::Continue; + } + } + else + { + return util::LoopControl::Continue; + } + }, + unknown_job + ); + if (control == util::LoopControl::Break) + { + break; + } + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/solution.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/solution.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9f52587f6d56145548343cc332f4ffea1db553db --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/solver/solution.hpp @@ -0,0 +1,261 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_SOLUTION_HPP +#define MAMBA_CORE_SOLUTION_HPP + +#include +#include +#include + +#include "mamba/specs/package_info.hpp" +#include "mamba/util/loop_control.hpp" +#include "mamba/util/type_traits.hpp" + +namespace mamba::solver +{ + struct Solution + { + struct Omit + { + specs::PackageInfo what; + }; + + struct Upgrade + { + specs::PackageInfo remove; + specs::PackageInfo install; + }; + + struct Downgrade + { + specs::PackageInfo remove; + specs::PackageInfo install; + }; + + struct Change + { + specs::PackageInfo remove; + specs::PackageInfo install; + }; + + struct Reinstall + { + specs::PackageInfo what; + }; + + struct Remove + { + specs::PackageInfo remove; + }; + + struct Install + { + specs::PackageInfo install; + }; + + template + inline static constexpr bool has_remove_v = util::is_any_of_v; + + template + inline static constexpr bool has_install_v = util::is_any_of_v; + + using Action = std::variant; + using action_list = std::vector; + + action_list actions = {}; + }; + + template + void for_each_to_remove(Iter first, Iter last, UnaryFunc&& func); + template + void for_each_to_remove(Range&& actions, UnaryFunc&& func); + + template + void for_each_to_install(Iter first, Iter last, UnaryFunc&& func); + template + void for_each_to_install(Range&& actions, UnaryFunc&& func); + + template + void for_each_to_omit(Iter first, Iter last, UnaryFunc&& func); + template + void for_each_to_omit(Range&& actions, UnaryFunc&& func); + + /******************************** + * Implementation of Solution * + ********************************/ + + namespace detail + { + template + auto to_remove_ptr(Action& action) + { + using PackageInfoPtr = std:: + conditional_t, const specs::PackageInfo*, specs::PackageInfo*>; + return std::visit( + [](auto& a) -> PackageInfoPtr + { + using A = std::decay_t; + if constexpr (Solution::has_remove_v) + { + return &(a.remove); + } + else if constexpr (std::is_same_v) + { + return &(a.what); + } + else + { + return nullptr; + } + }, + action + ); + } + } + + // TODO(C++20): Poor man's replacement to range filter transform + template + void for_each_to_remove(Iter first, Iter last, UnaryFunc&& func) + { + for (; first != last; ++first) + { + if (auto* const ptr = detail::to_remove_ptr(*first)) + { + if constexpr (std::is_same_v) + { + if (func(*ptr) == util::LoopControl::Break) + { + break; + } + } + else + { + func(*ptr); + } + } + } + } + + template + void for_each_to_remove(Range&& actions, UnaryFunc&& func) + { + return for_each_to_remove(actions.begin(), actions.end(), std::forward(func)); + } + + namespace detail + { + template + auto to_install_ptr(Action& action) + { + using PackageInfoPtr = std:: + conditional_t, const specs::PackageInfo*, specs::PackageInfo*>; + return std::visit( + [](auto& a) -> PackageInfoPtr + { + using A = std::decay_t; + if constexpr (Solution::has_install_v) + { + return &(a.install); + } + else if constexpr (std::is_same_v) + { + return &(a.what); + } + else + { + return nullptr; + } + }, + action + ); + } + } + + template + void for_each_to_install(Iter first, Iter last, UnaryFunc&& func) + { + for (; first != last; ++first) + { + if (auto* const ptr = detail::to_install_ptr(*first)) + { + if constexpr (std::is_same_v) + { + if (func(*ptr) == util::LoopControl::Break) + { + break; + } + } + else + { + func(*ptr); + } + } + } + } + + // TODO(C++20): Poor man's replacement to range filter transform + template + void for_each_to_install(Range&& actions, UnaryFunc&& func) + { + return for_each_to_install(actions.begin(), actions.end(), std::forward(func)); + } + + namespace detail + { + template + auto to_omit_ptr(Action& action) + { + using PackageInfoPtr = std:: + conditional_t, const specs::PackageInfo*, specs::PackageInfo*>; + return std::visit( + [](auto& a) -> PackageInfoPtr + { + using A = std::decay_t; + if constexpr (std::is_same_v) + { + return &(a.what); + } + else + { + return nullptr; + } + }, + action + ); + } + } + + // TODO(C++20): Poor man's replacement to range filter transform + template + void for_each_to_omit(Iter first, Iter last, UnaryFunc&& func) + { + for (; first != last; ++first) + { + if (auto* const ptr = detail::to_omit_ptr(*first)) + { + if constexpr (std::is_same_v) + { + if (func(*ptr) == util::LoopControl::Break) + { + break; + } + } + else + { + func(*ptr); + } + } + } + } + + template + void for_each_to_omit(Range&& actions, UnaryFunc&& func) + { + return for_each_to_omit(actions.begin(), actions.end(), std::forward(func)); + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/archive.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/archive.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0454a816bf9da4aec8758accf22233f7e8e340f9 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/archive.hpp @@ -0,0 +1,52 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_ARCHIVE_HPP +#define MAMBA_SPECS_ARCHIVE_HPP + +#include +#include +#include + +#include "mamba/fs/filesystem.hpp" + +namespace mamba::specs +{ + inline static constexpr auto ARCHIVE_EXTENSIONS = std::array{ std::string_view(".tar.bz2"), + std::string_view(".conda"), + std::string_view(".whl"), + std::string_view(".tar.gz") }; + + /** Detect if the package path has one of the known archive extension. */ + template , bool> = true> + [[nodiscard]] auto has_archive_extension(const Str& path) -> bool; + [[nodiscard]] auto has_archive_extension(std::string_view path) -> bool; + [[nodiscard]] auto has_archive_extension(const fs::u8path& path) -> bool; + + /** Remove the known archive extension from the package path if present. */ + template , bool> = true> + [[nodiscard]] auto strip_archive_extension(const Str& path) -> std::string_view; + [[nodiscard]] auto strip_archive_extension(std::string_view path) -> std::string_view; + [[nodiscard]] auto strip_archive_extension(fs::u8path path) -> fs::u8path; + + /******************** + * Implementation * + ********************/ + + template , bool>> + [[nodiscard]] auto has_archive_extension(const Str& path) -> bool + { + return has_archive_extension(std::string_view(path)); + } + + template , bool>> + [[nodiscard]] auto strip_archive_extension(const Str& path) -> std::string_view + { + return strip_archive_extension(std::string_view(path)); + } + +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/authentication_info.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/authentication_info.hpp new file mode 100644 index 0000000000000000000000000000000000000000..02455fc31e6aec4000edbadf616cf3ec705c23c0 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/authentication_info.hpp @@ -0,0 +1,109 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_AUTHENTICATION_INFO_HPP +#define MAMBA_SPECS_AUTHENTICATION_INFO_HPP + +#include +#include +#include +#include +#include +#include + +#include "mamba/util/weakening_map.hpp" + +namespace mamba::specs +{ + /** User and password authetification set in the URL. */ + struct BasicHTTPAuthentication + { + std::string user; + std::string password; + }; + + auto operator==(const BasicHTTPAuthentication& a, const BasicHTTPAuthentication& b) -> bool; + auto operator!=(const BasicHTTPAuthentication& a, const BasicHTTPAuthentication& b) -> bool; + + /** HTTP Bearer token set in the request headers. */ + struct BearerToken + { + std::string token; + }; + + auto operator==(const BearerToken& a, const BearerToken& b) -> bool; + auto operator!=(const BearerToken& a, const BearerToken& b) -> bool; + + /** A Conda token set in the URL path. */ + struct CondaToken + { + std::string token; + }; + + auto operator==(const CondaToken& a, const CondaToken& b) -> bool; + auto operator!=(const CondaToken& a, const CondaToken& b) -> bool; + + using AuthenticationInfo = std::variant; + + /** + * The weakener for @ref AuthenticationDataBase. + */ + struct URLWeakener + { + /** + * Add a trailing '/' if abscent. + * + * This lets "mamba.org/" be found by "mamba.org" key. + */ + [[nodiscard]] auto make_first_key(std::string_view key) const -> std::string; + + /** + * Remove the last part of the URL path, or simply the trailing slash. + * + * For instance, iterations mya follow + * "mamba.org/p/chan" > "mamba.org/p/" > "mamba.org/p" > "mamba.org/" > "mamba.org". + */ + [[nodiscard]] auto weaken_key(std::string_view key) const -> std::optional; + }; + + /** + * A class that holds the authentication info stored by users. + * + * Essentially a map, except that some keys can match multiple queries. + * For instance "mamba.org/private" should be matched by queries "mamba.org/private", + * "mamba.org/private/channel", but not "mamba.org/public". + * + * A best effort is made to satifiy this with `xxx_compatible`. + * + * Future development of this class should aim to replace the map and keys with a + * `AuthenticationSpec`, that can decide whether or not a URL should benefit from such + * its authentication. + * Possibly, a string representation such as "*.mamba.org/private/channel*" could be added + * to parse users intentions, rather than relying on the assumptions made here. + */ + using AuthenticationDataBase = util:: + weakening_map, URLWeakener>; +} + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::BasicHTTPAuthentication& auth) const -> std::size_t; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::BearerToken& auth) const -> std::size_t; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::CondaToken& auth) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/build_number_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/build_number_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ea03242452b27070f75005966aca18573fc4c2a1 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/build_number_spec.hpp @@ -0,0 +1,184 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_BUILD_NUMBER_SPEC_HPP +#define MAMBA_SPECS_BUILD_NUMBER_SPEC_HPP + +#include +#include +#include +#include + +#include + +#include "mamba/specs/error.hpp" + +namespace mamba::specs +{ + /** + * A stateful unary boolean function on the integer space. + */ + class BuildNumberPredicate + { + public: + + using BuildNumber = std::size_t; + + [[nodiscard]] static auto make_free() -> BuildNumberPredicate; + [[nodiscard]] static auto make_equal_to(BuildNumber ver) -> BuildNumberPredicate; + [[nodiscard]] static auto make_not_equal_to(BuildNumber ver) -> BuildNumberPredicate; + [[nodiscard]] static auto make_greater(BuildNumber ver) -> BuildNumberPredicate; + [[nodiscard]] static auto make_greater_equal(BuildNumber ver) -> BuildNumberPredicate; + [[nodiscard]] static auto make_less(BuildNumber ver) -> BuildNumberPredicate; + [[nodiscard]] static auto make_less_equal(BuildNumber ver) -> BuildNumberPredicate; + + /** Construct an free interval. */ + BuildNumberPredicate() = default; + + /** + * True if the predicate contains the given build_number. + */ + [[nodiscard]] auto contains(const BuildNumber& point) const -> bool; + + [[nodiscard]] auto to_string() const -> std::string; + + private: + + struct free_interval + { + auto operator()(const BuildNumber&, const BuildNumber&) const -> bool; + }; + + /** + * Operator to compare with the stored build_number. + */ + using BinaryOperator = std::variant< + free_interval, + std::equal_to, + std::not_equal_to, + std::greater, + std::greater_equal, + std::less, + std::less_equal>; + + BuildNumber m_build_number = {}; + BinaryOperator m_operator = free_interval{}; + + BuildNumberPredicate(BuildNumber ver, BinaryOperator op); + + friend auto equal(free_interval, free_interval) -> bool; + friend auto operator==(const BuildNumberPredicate& lhs, const BuildNumberPredicate& rhs) + -> bool; + friend struct ::fmt::formatter; + }; + + auto operator==(const BuildNumberPredicate& lhs, const BuildNumberPredicate& rhs) -> bool; + auto operator!=(const BuildNumberPredicate& lhs, const BuildNumberPredicate& rhs) -> bool; + + /** + * Match a build number with a predicate. + * + * Conda does not implement expression for build numbers but they could be added similarly + * to @ref VersionSpec. + */ + class BuildNumberSpec + { + public: + + using BuildNumber = typename BuildNumberPredicate::BuildNumber; + + static constexpr std::string_view preferred_free_str = "=*"; + static constexpr std::array all_free_strs = { "", "*", "=*", "==*" }; + static constexpr std::string_view equal_str = "="; + static constexpr std::string_view not_equal_str = "!="; + static constexpr std::string_view greater_str = ">"; + static constexpr std::string_view greater_equal_str = ">="; + static constexpr std::string_view less_str = "<"; + static constexpr std::string_view less_equal_str = "<="; + + [[nodiscard]] static auto parse(std::string_view str) -> expected_parse_t; + + /** Construct BuildNumberSpec that match all versions. */ + BuildNumberSpec(); + + explicit BuildNumberSpec(BuildNumberPredicate predicate) noexcept; + + /** + * Returns whether the BuildNumberSpec is unconstrained. + */ + [[nodiscard]] auto is_explicitly_free() const -> bool; + + /** + * A string representation of the build number spec. + * + * May not always be the same as the parsed string (due to reconstruction) but reparsing + * this string will give the same build number spec. + */ + [[nodiscard]] auto to_string() const -> std::string; + + /** + * True if the set described by the BuildNumberSpec contains the given version. + */ + [[nodiscard]] auto contains(BuildNumber point) const -> bool; + + [[nodiscard]] auto operator==(const BuildNumberSpec& other) const -> bool = default; + + [[nodiscard]] auto operator!=(const BuildNumberSpec& other) const -> bool = default; + + private: + + BuildNumberPredicate m_predicate; + + friend struct ::fmt::formatter; + }; + + namespace build_number_spec_literals + { + auto operator""_bs(const char* str, std::size_t len) -> BuildNumberSpec; + } +} + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw format_error("invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::BuildNumberPredicate& pred, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw format_error("invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::BuildNumberSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::BuildNumberSpec& spec) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/channel.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/channel.hpp new file mode 100644 index 0000000000000000000000000000000000000000..26e829a7284f46fb6d416f58e601fd1739761ab7 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/channel.hpp @@ -0,0 +1,160 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#include +#include +#include +#include +#include + +#include "mamba/specs/authentication_info.hpp" +#include "mamba/specs/conda_url.hpp" +#include "mamba/specs/error.hpp" +#include "mamba/specs/unresolved_channel.hpp" +#include "mamba/util/flat_set.hpp" +#include "mamba/util/weakening_map.hpp" + +#ifndef MAMBA_SPECS_CHANNEL_HPP +#define MAMBA_SPECS_CHANNEL_HPP + +namespace mamba::specs +{ + struct ChannelResolveParams; + struct ChannelResolveParamsView; + + class Channel + { + public: + + using platform_list = util::flat_set; + using channel_list = std::vector; + + [[nodiscard]] static auto resolve( // + UnresolvedChannel uc, + const ChannelResolveParams& params + ) -> expected_parse_t; + + [[nodiscard]] static auto resolve( // + UnresolvedChannel uc, + ChannelResolveParamsView params + ) -> expected_parse_t; + + Channel(CondaURL url, std::string display_name, platform_list platforms = {}); + Channel(std::vector mirror_urls, std::string display_name, platform_list platforms = {}); + + [[nodiscard]] auto is_package() const -> bool; + + [[nodiscard]] auto mirror_urls() const -> const std::vector&; + [[nodiscard]] auto platform_mirror_urls() const -> std::vector; + [[nodiscard]] auto platform_mirror_urls(const std::string_view platform) const + -> std::vector; + + [[nodiscard]] auto url() const -> const CondaURL&; + auto clear_url() -> const CondaURL; + void set_url(CondaURL url); + + [[nodiscard]] auto platform_urls() const -> std::vector; + + [[nodiscard]] auto platform_url(std::string_view platform) const -> CondaURL; + + [[nodiscard]] auto platforms() const -> const platform_list&; + auto clear_platforms() -> platform_list; + void set_platforms(platform_list platforms); + + /* + * This ID is a cross URL id, and is dependent on the + * channel_alias when the channel has not been specified in + * the new mirrored_channel section of the configuration. + */ + [[nodiscard]] auto id() const -> const std::string&; + [[nodiscard]] auto display_name() const -> const std::string&; + auto clear_display_name() -> std::string; + void set_display_name(std::string display_name); + + enum struct Match + { + No, + InOtherPlatform, + Full, + }; + + [[nodiscard]] auto url_equivalent_with(const Channel& other) const -> bool; + + [[nodiscard]] auto is_equivalent_to(const Channel& other) const -> bool; + + [[nodiscard]] auto contains_equivalent(const Channel& other) const -> bool; + + [[nodiscard]] auto contains_package(const CondaURL& pkg) const -> Match; + + private: + + CondaURL platform_url_impl(const CondaURL& url, const std::string_view platform) const; + + std::vector m_mirror_urls; + std::string m_display_name; + std::string m_id; + util::flat_set m_platforms; + }; + + struct ChannelResolveParams + { + /** + * The weakener for @ref ResolveParams::custom_channels. + */ + struct NameWeakener + { + /** + * Return the key unchanged. + */ + [[nodiscard]] auto make_first_key(std::string_view key) const -> std::string_view; + + /** + * Remove the last element of the '/'-separated name. + */ + [[nodiscard]] auto weaken_key(std::string_view key) const + -> std::optional; + }; + + template + using name_map = util::weakening_map, NameWeakener>; + + using platform_list = util::flat_set; + using channel_list = std::vector; + using channel_map = name_map; + using multichannel_map = name_map; + + platform_list platforms = {}; + CondaURL channel_alias = {}; + channel_map custom_channels = {}; + multichannel_map custom_multichannels = {}; + AuthenticationDataBase authentication_db = {}; + std::string home_dir = {}; + std::string current_working_dir = {}; + }; + + struct ChannelResolveParamsView + { + const ChannelResolveParams::platform_list& platforms = {}; + const CondaURL& channel_alias = {}; + const ChannelResolveParams::channel_map& custom_channels = {}; + const ChannelResolveParams::multichannel_map& custom_multichannels = {}; + const AuthenticationDataBase& authentication_db = {}; + std::string_view home_dir = {}; + std::string_view current_working_dir = {}; + }; + + /** Tuple-like equality of all observable members */ + auto operator==(const Channel& a, const Channel& b) -> bool; + auto operator!=(const Channel& a, const Channel& b) -> bool; +} + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::Channel& c) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/chimera_string_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/chimera_string_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5d2bd1b35bd422fc86c75b88ffb4163b5188b59d --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/chimera_string_spec.hpp @@ -0,0 +1,95 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_CHIMERA_STRING_SPEC +#define MAMBA_SPECS_CHIMERA_STRING_SPEC + +#include +#include + +#include +#include + +#include "mamba/specs/error.hpp" +#include "mamba/specs/glob_spec.hpp" +#include "mamba/specs/regex_spec.hpp" + +namespace mamba::specs +{ + /** + * A matcher for either a glob or a regex expression. + */ + class ChimeraStringSpec + { + public: + + using Chimera = std::variant; + + [[nodiscard]] static auto parse(std::string pattern) -> expected_parse_t; + + ChimeraStringSpec(); + explicit ChimeraStringSpec(Chimera spec); + + [[nodiscard]] auto contains(std::string_view str) const -> bool; + + /** + * Return true if the spec will match true on any input. + */ + [[nodiscard]] auto is_explicitly_free() const -> bool; + + /** + * Return true if the spec will match exactly one input. + */ + [[nodiscard]] auto is_exact() const -> bool; + + /** + * Return true if the spec is a glob and not a regex. + */ + [[nodiscard]] auto is_glob() const -> bool; + + [[nodiscard]] auto to_string() const -> const std::string&; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const ChimeraStringSpec& other) const -> bool + { + return m_spec == other.m_spec; + } + + [[nodiscard]] auto operator!=(const ChimeraStringSpec& other) const -> bool + { + return !(*this == other); + } + + private: + + Chimera m_spec; + }; +} + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::ChimeraStringSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::ChimeraStringSpec& spec) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/conda_url.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/conda_url.hpp new file mode 100644 index 0000000000000000000000000000000000000000..27d511b030733ebe27e9eaa0feac2b4d1af38ee5 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/conda_url.hpp @@ -0,0 +1,262 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_CONDA_URL_HPP +#define MAMBA_SPECS_CONDA_URL_HPP + +#include +#include + +#include "mamba/specs/error.hpp" +#include "mamba/specs/platform.hpp" +#include "mamba/util/url.hpp" + +namespace mamba::specs +{ + class CondaURL : private util::URL + { + using Base = typename util::URL; + + public: + + using StripScheme = util::detail::StripScheme; + using Credentials = util::detail::Credentials; + using Encode = util::detail::Encode; + using Decode = util::detail::Decode; + + inline static constexpr std::string_view token_prefix = "/t/"; + + /** Parse a string url. + * The url must be percent encoded beforehand. + * cf. https://en.wikipedia.org/wiki/Percent-encoding + */ + [[nodiscard]] static auto parse(std::string_view url) -> expected_parse_t; + + /** Create a local URL. */ + CondaURL() = default; + explicit CondaURL(util::URL&& url); + explicit CondaURL(const util::URL& url); + + [[nodiscard]] auto generic() const -> const util::URL&; + + using Base::scheme_is_defaulted; + using Base::scheme; + using Base::set_scheme; + using Base::clear_scheme; + using Base::has_user; + using Base::user; + using Base::set_user; + using Base::clear_user; + using Base::has_password; + using Base::password; + using Base::set_password; + using Base::clear_password; + using Base::authentication; + using Base::host_is_defaulted; + using Base::host; + using Base::set_host; + using Base::clear_host; + using Base::port; + using Base::set_port; + using Base::clear_port; + using Base::authority; + using Base::path; + using Base::pretty_path; + using Base::clear_path; + using Base::query; + using Base::set_query; + using Base::clear_query; + using Base::fragment; + using Base::set_fragment; + using Base::clear_fragment; + + /** + * Set the path from a not encoded value. + * + * All '/' are not encoded but interpreted as separators. + * On windows with a file scheme, the colon after the drive letter is not encoded. + * A leading '/' is added if abscent. + * If the path contains only a token, a trailing '/' is added afterwards. + */ + void set_path(std::string_view path, Encode::yes_type = Encode::yes); + + /** Set the path from an already encoded value. + * + * A leading '/' is added if abscent. + * If the path contains only a token, a trailing '/' is added afterwards. + */ + void set_path(std::string path, Encode::no_type); + + /** + * Append a not encoded sub path to the current path. + * + * Contrary to `std::filesystem::path::append`, this always append and never replace + * the current path, even if @p subpath starts with a '/'. + * All '/' are not encoded but interpreted as separators. + * If the final path contains only a token, a trailing '/' is added afterwards. + */ + void append_path(std::string_view path, Encode::yes_type = Encode::yes); + + /** + * Append a already encoded sub path to the current path. + * + * Contrary to `std::filesystem::path::append`, this always append and never replace + * the current path, even if @p subpath starts with a '/'. + * If the final path contains only a token, a trailing '/' is added afterwards. + */ + void append_path(std::string_view path, Encode::no_type); + + /** Return whether a token is set. */ + [[nodiscard]] auto has_token() const -> bool; + + /** Return the Conda token, as delimited with "/t/", or empty if there isn't any. */ + [[nodiscard]] auto token() const -> std::string_view; + + /** + * Set a token. + * + * If the URL already contains one replace it at the same location, otherwise, add it at + * the beginning of the path. + */ + void set_token(std::string_view token); + + /** Clear the token and return ``true`` if it exists, otherwise return ``false``. */ + auto clear_token() -> bool; + + /** Return the encoded part of the path without any Conda token, always start with '/'. */ + [[nodiscard]] auto path_without_token(Decode::no_type) const -> std::string_view; + + /** Return the decoded part of the path without any Conda token, always start with '/'. */ + [[nodiscard]] auto path_without_token(Decode::yes_type = Decode::yes) const -> std::string; + + /** + * Set the path from an already encoded value, without changing the Conda token. + * + * A leading '/' is added if abscent. + */ + void set_path_without_token(std::string_view path, Encode::no_type); + + /** + * Set the path from an not yet encoded value, without changing the Conda token. + * + * A leading '/' is added if abscent. + */ + void set_path_without_token(std::string_view path, Encode::yes_type = Encode::yes); + + /** Clear the path without changing the Conda token and return ``true`` if it exists. */ + auto clear_path_without_token() -> bool; + + /** Return the platform if part of the URL path. */ + [[nodiscard]] auto platform() const -> std::optional; + + /** + * Return the platform if part of the URL path, or empty. + * + * If a platform is found, it is returned as a view onto the path without normalization + * (for instance the capitalization isn't changed). + */ + [[nodiscard]] auto platform_name() const -> std::string_view; + + /** Set the platform if the URL already contains one, or throw an error. */ + void set_platform(KnownPlatform platform); + + /** + * Set the platform if the URL already contains one, or throw an error. + * + * If the input @p platform is a valid platform, it is inserted as it is into the path + * (for instance the capitalization isn't changed). + */ + void set_platform(std::string_view platform); + + /** Clear the token and return true if it exists, otherwise return ``false``. */ + auto clear_platform() -> bool; + + /** + * Return the encoded package name, or empty otherwise. + * + * Package name are at the end of the path and end with a archive extension. + * + * @see has_archive_extension + */ + [[nodiscard]] auto package(Decode::yes_type = Decode::yes) const -> std::string; + + /** + * Return the decoded package name, or empty otherwise. + * + * Package name are at the end of the path and end with a archive extension. + * + * @see has_archive_extension + */ + [[nodiscard]] auto package(Decode::no_type) const -> std::string_view; + + /** + * Change the package file name with a not encoded value. + * + * If a package file name is present, replace it, otherwise add it at the end + * of the path. + */ + void set_package(std::string_view pkg, Encode::yes_type = Encode::yes); + + /** + * Change the package file name with already encoded value. + * + * If a package file name is present, replace it, otherwise add it at the end + * of the path. + */ + void set_package(std::string_view pkg, Encode::no_type); + + /** Clear the package and return true if it exists, otherwise return ``false``. */ + auto clear_package() -> bool; + + /** Return the full, exact, encoded URL. */ + [[nodiscard]] auto str(Credentials credentials = Credentials::Hide) const -> std::string; + + /** + * Return the full decoded url. + * + * Due to decoding, the outcome may not be understood by parser and usable to reach an + * asset. + * @param strip_scheme If true, remove the scheme and "localhost" on file URI. + * @param rstrip_path If non-null, remove the given characters at the end of the path. + * @param credentials If true, hide password and tokens in the decoded string. + * @param credentials Decide to keep, remove, or hide passwrd, users, and token. + */ + [[nodiscard]] auto pretty_str( + StripScheme strip_scheme = StripScheme::no, + char rstrip_path = 0, + Credentials credentials = Credentials::Hide + ) const -> std::string; + + + private: + + void set_platform_no_check_input(std::string_view platform); + void ensure_path_without_token_leading_slash(); + + friend auto operator==(const CondaURL&, const CondaURL&) -> bool; + }; + + /** Tuple-like equality of all observable members */ + auto operator==(const CondaURL& a, const CondaURL& b) -> bool; + auto operator!=(const CondaURL& a, const CondaURL& b) -> bool; + + /** A functional equivalent to ``CondaURL::append_path``. */ + auto operator/(const CondaURL& url, std::string_view subpath) -> CondaURL; + auto operator/(CondaURL&& url, std::string_view subpath) -> CondaURL; + + namespace conda_url_literals + { + auto operator""_cu(const char* str, std::size_t len) -> CondaURL; + } +} + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::CondaURL& p) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/error.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/error.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d764463a178a7e4fa1eb6ed950a0b2d95da4a3cf --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/error.hpp @@ -0,0 +1,39 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_ERROR_HPP +#define MAMBA_SPECS_ERROR_HPP + +#include +#include + +#include + +namespace mamba::specs +{ + + struct ParseError final : std::invalid_argument + { + using std::invalid_argument::invalid_argument; + }; + + template + using expected_parse_t = tl::expected; + + template + [[nodiscard]] auto make_unexpected_parse(T&& err) -> tl::unexpected; + + /******************** + * Implementation * + ********************/ + + template + auto make_unexpected_parse(T&& err) -> tl::unexpected + { + return tl::make_unexpected(ParseError(std::forward(err))); + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/glob_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/glob_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f1f1c8536cef4fff143b9d7033a0a7fd1fa3a637 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/glob_spec.hpp @@ -0,0 +1,87 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_GLOB_SPEC +#define MAMBA_SPECS_GLOB_SPEC + +#include +#include + +#include +#include + +namespace mamba::specs +{ + /** + * A matcher for glob expression. + * + * Currently only support "*" wildcard for matching zero or more characters. + */ + class GlobSpec + { + public: + + inline static constexpr std::string_view free_pattern = "*"; + inline static constexpr char glob_pattern = '*'; + + GlobSpec() = default; + explicit GlobSpec(std::string pattern); + + [[nodiscard]] auto contains(std::string_view str) const -> bool; + + /** + * Return true if the spec will match true on any input. + */ + [[nodiscard]] auto is_free() const -> bool; + + /** + * Return true if the spec will match exactly one input. + */ + [[nodiscard]] auto is_exact() const -> bool; + + [[nodiscard]] auto to_string() const -> const std::string&; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const GlobSpec& other) const -> bool + { + return m_pattern == other.m_pattern; + } + + [[nodiscard]] auto operator!=(const GlobSpec& other) const -> bool + { + return !(*this == other); + } + + private: + + std::string m_pattern = std::string(free_pattern); + }; +} + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::GlobSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::GlobSpec& spec) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/match_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/match_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..943d86b7dcf9d13fe6a631fd01175b652f4c085f --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/match_spec.hpp @@ -0,0 +1,320 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_MATCH_SPEC +#define MAMBA_SPECS_MATCH_SPEC + +#include +#include +#include +#include + +#include +#include + +#include "mamba/specs/build_number_spec.hpp" +#include "mamba/specs/chimera_string_spec.hpp" +#include "mamba/specs/error.hpp" +#include "mamba/specs/glob_spec.hpp" +#include "mamba/specs/unresolved_channel.hpp" +#include "mamba/specs/version_spec.hpp" +#include "mamba/util/flat_set.hpp" +#include "mamba/util/heap_optional.hpp" + +namespace mamba::specs +{ + class PackageInfo; + + class MatchSpec + { + public: + + using NameSpec = GlobSpec; + using BuildStringSpec = ChimeraStringSpec; + using platform_set = typename UnresolvedChannel::platform_set; + using platform_set_const_ref = std::reference_wrapper; + using string_set = typename util::flat_set; + using string_set_const_ref = typename std::reference_wrapper; + + inline static constexpr char url_md5_sep = '#'; + inline static constexpr char preferred_list_open = '['; + inline static constexpr char preferred_list_close = ']'; + inline static constexpr char alt_list_open = '('; + inline static constexpr char alt_list_close = ')'; + inline static constexpr char preferred_quote = '"'; + inline static constexpr char alt_quote = '\''; + inline static constexpr char channel_namespace_spec_sep = ':'; + inline static constexpr char attribute_sep = ','; + inline static constexpr char attribute_assign = '='; + inline static constexpr auto package_version_sep = std::array{ ' ', '=', '<', '>', '~', '!' }; + inline static constexpr auto feature_sep = std::array{ ' ', ',' }; + + + [[nodiscard]] static auto parse(std::string_view spec) -> expected_parse_t; + + [[nodiscard]] static auto parse_url(std::string_view spec) -> expected_parse_t; + + [[nodiscard]] auto channel() const -> const std::optional&; + void set_channel(std::optional chan); + + [[nodiscard]] auto filename() const -> std::string_view; + void set_filename(std::string val); + + [[nodiscard]] auto is_file() const -> bool; + + [[nodiscard]] auto platforms() const -> std::optional; + void set_platforms(platform_set val); + + [[nodiscard]] auto name_space() const -> const std::string&; + void set_name_space(std::string ns); + + [[nodiscard]] auto name() const -> const NameSpec&; + void set_name(NameSpec name); + + [[nodiscard]] auto version() const -> const VersionSpec&; + void set_version(VersionSpec ver); + + [[nodiscard]] auto build_number() const -> const BuildNumberSpec&; + void set_build_number(BuildNumberSpec num); + + [[nodiscard]] auto build_string() const -> const BuildStringSpec&; + void set_build_string(BuildStringSpec bs); + + [[nodiscard]] auto md5() const -> std::string_view; + void set_md5(std::string val); + + [[nodiscard]] auto sha256() const -> std::string_view; + void set_sha256(std::string val); + + [[nodiscard]] auto license() const -> std::string_view; + void set_license(std::string val); + + [[nodiscard]] auto license_family() const -> std::string_view; + void set_license_family(std::string val); + + [[nodiscard]] auto features() const -> std::string_view; + void set_features(std::string val); + + [[nodiscard]] auto track_features() const -> std::optional; + void set_track_features(string_set val); + + [[nodiscard]] auto optional() const -> bool; + void set_optional(bool opt); + + [[nodiscard]] auto conda_build_form() const -> std::string; + [[nodiscard]] auto to_string() const -> std::string; + + /** + * Return true if the MatchSpec can be written as `` ``. + */ + [[nodiscard]] auto is_simple() const -> bool; + + /** + * Return true if the MatchSpec contains an exact package name and nothing else. + */ + [[nodiscard]] auto is_only_package_name() const -> bool; + + /** + * Make a new MatchSpec that matches only on the name part. + */ + [[nodiscard]] auto to_named_spec() const -> MatchSpec; + + /** + * Check if the MatchSpec matches the given package. + * + * The check exclude anything related to the channel, du to the difficulties in + * comparing unresolved channels and the fact that this check can be also be done once + * at a repository level when the user knows how packages are organised. + * + * This function is written as a generic template, to accommodate various uses: the fact + * that the attributes may not always be in the correct format in the package, and that + * their parsing may be cached. + */ + template + [[nodiscard]] auto contains_except_channel(const Pkg& pkg) const -> bool; + + /** + * Convenience wrapper making necessary conversions. + */ + [[nodiscard]] auto contains_except_channel(const PackageInfo& pkg) const -> bool; + + /** + * Naive attribute-wise comparison. + * + * @warning Some complex matchspec could compare to false but actually represent the same + * set of packages. This strong equality is hard to detect. + */ + [[nodiscard]] auto operator==(const MatchSpec& other) const -> bool = default; + + [[nodiscard]] auto operator!=(const MatchSpec& other) const -> bool = default; + + auto extra_members_hash() const -> std::size_t; + + private: + + struct ExtraMembers + { + // The filename is stored as part of the channel when it is a full Package URL + std::string filename = {}; + // The filename is stored as part of the channel when it is available + platform_set subdirs = {}; + std::string md5 = {}; + std::string sha256 = {}; + std::string license = {}; + std::string license_family = {}; + std::string features = {}; + string_set track_features = {}; + bool optional = false; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const ExtraMembers& other) const -> bool + { + return filename == other.filename // + && subdirs == other.subdirs // + && md5 == other.md5 // + && sha256 == other.sha256 // + && license == other.license // + && license_family == other.license_family // + && features == other.features // + && track_features == other.track_features // + && optional == other.optional; + } + + [[nodiscard]] auto operator!=(const ExtraMembers& other) const -> bool + { + return !(*this == other); + } + + friend struct std::hash; + }; + friend struct std::hash; + + std::optional m_channel; + VersionSpec m_version; + NameSpec m_name; + BuildStringSpec m_build_string; + std::string m_name_space; + BuildNumberSpec m_build_number; + util::heap_optional m_extra = {}; // unlikely data + + auto extra() -> ExtraMembers&; + + [[nodiscard]] auto channel_is_file() const -> bool; + [[nodiscard]] auto channel_filename() const -> std::string_view; + void set_channel_filename(std::string val); + + [[nodiscard]] auto extra_filename() const -> std::string_view; + void set_extra_filename(std::string val); + + [[nodiscard]] auto extra_subdirs() const -> std::optional; + void set_extra_subdirs(platform_set val); + }; + + namespace match_spec_literals + { + auto operator""_ms(const char* str, std::size_t len) -> MatchSpec; + } +} + +template <> +struct fmt::formatter<::mamba::specs::MatchSpec> +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::MatchSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::MatchSpec& spec) const -> std::size_t; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::MatchSpec::ExtraMembers& extra) const -> std::size_t; +}; + +/********************************* + * Implementation of MatchSpec * + *********************************/ + +namespace mamba::specs +{ + namespace detail + { + template + struct Deref + { + template + static auto deref(T&& x) -> decltype(auto) + { + return x; + } + }; + + template + struct Deref> + { + template + static auto deref(T&& x) -> decltype(auto) + { + return std::forward(x).get(); + } + }; + + template + auto invoke_pkg(Attr&& attr, Pkg&& pkg) -> decltype(auto) + { + using Return = std::decay_t>; + return Deref::deref(std::invoke(std::forward(attr), std::forward(pkg))); + } + } + + template + auto MatchSpec::contains_except_channel(const Pkg& pkg) const -> bool + { + if ( // + !name().contains(detail::invoke_pkg(&Pkg::name, pkg)) // + || !version().contains(detail::invoke_pkg(&Pkg::version, pkg)) // + || !build_string().contains(detail::invoke_pkg(&Pkg::build_string, pkg)) // + || !build_number().contains(detail::invoke_pkg(&Pkg::build_number, pkg)) // + || (!md5().empty() && (md5() != detail::invoke_pkg(&Pkg::md5, pkg))) // + || (!sha256().empty() && (sha256() != detail::invoke_pkg(&Pkg::sha256, pkg))) // + || (!license().empty() && (license() != detail::invoke_pkg(&Pkg::license, pkg))) // + ) + { + return false; + } + + if (const auto& plats = platforms(); + plats.has_value() && !plats->get().contains(detail::invoke_pkg(&Pkg::platform, pkg))) + { + return false; + } + + if (const auto& tfeats = track_features(); + tfeats.has_value() + && !util::set_is_subset_of(tfeats->get(), detail::invoke_pkg(&Pkg::track_features, pkg))) + { + return false; + } + + return true; + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/package_info.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/package_info.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0cdd9f6d8dbda6f64b4714edc9e4e22cdce15b8c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/package_info.hpp @@ -0,0 +1,137 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_PACKAGE_INFO +#define MAMBA_CORE_PACKAGE_INFO + +#include +#include +#include + +#include + +#include "mamba/specs/error.hpp" +#include "mamba/specs/platform.hpp" +#include "mamba/util/tuple_hash.hpp" + +namespace mamba::specs +{ + enum class PackageType + { + Unknown, + Conda, + Wheel, + TarGz, + }; + + class PackageInfo + { + public: + + std::string name = {}; + std::string version = {}; + std::string build_string = {}; + std::size_t build_number = 0; + /** + * Could contain "conda-forge", "conda-forge/linux-64", or a url. + * + * @todo need to use a proper type for channels + */ + std::string channel = {}; + std::string package_url = {}; + DynamicPlatform platform = {}; + std::string filename = {}; + std::string license = {}; + std::string md5 = {}; + std::string sha256 = {}; + std::string python_site_packages_path = {}; + std::string signatures = {}; + std::vector track_features = {}; + std::vector dependencies = {}; + std::vector constrains = {}; + // WARNING Be aware that `defaulted_keys` value, if set later, + // is not passed when going through `make_package_info` from libsolv + std::vector defaulted_keys = {}; + NoArchType noarch = NoArchType::No; + std::size_t size = 0; + std::size_t timestamp = 0; + // FIXME this is a temporary hack to accommodate Python wheels but wheels and conda + // PackageInfo, should really be split in different types. + // WARNING Be aware that `package_type` value, + // if set later to anything other than default (PackageType::Unknown), + // will not be passed when going through `make_package_info` from libsolv + PackageType package_type = PackageType::Unknown; + + [[nodiscard]] static auto from_url(std::string_view url) -> expected_parse_t; + + PackageInfo() = default; + explicit PackageInfo(std::string name); + PackageInfo(std::string name, std::string version, std::string build_string, std::size_t build_number); + PackageInfo(std::string name, std::string version, std::string build_string, std::string channel); + + [[nodiscard]] auto json_signable() const -> nlohmann::json; + // TODO: rename to_string, following C++ conventions + [[nodiscard]] auto str() const -> std::string; + [[nodiscard]] auto long_str() const -> std::string; + + /** + * Dynamically get a field (e.g. name, version) as a string. + */ + [[nodiscard]] auto field(std::string_view name) const -> std::string; + }; + + auto operator==(const PackageInfo& lhs, const PackageInfo& rhs) -> bool; + + auto operator!=(const PackageInfo& lhs, const PackageInfo& rhs) -> bool; + + void to_json(nlohmann::json& j, const PackageInfo& pkg); + + void from_json(const nlohmann::json& j, PackageInfo& pkg); +} + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::PackageInfo& pkg) const -> std::size_t + { + auto seed = std::size_t(0); + seed = mamba::util::hash_vals( + seed, + pkg.name, + pkg.version, + pkg.build_string, + pkg.build_number, + pkg.channel, + pkg.package_url, + pkg.platform, + pkg.filename, + pkg.license, + pkg.md5, + pkg.sha256, + pkg.signatures + ); + seed = mamba::util::hash_combine_val_range( + seed, + pkg.track_features.begin(), + pkg.track_features.end() + ); + seed = mamba::util::hash_combine_val_range( + seed, + pkg.dependencies.begin(), + pkg.dependencies.end() + ); + seed = mamba::util::hash_combine_val_range(seed, pkg.constrains.begin(), pkg.constrains.end()); + seed = mamba::util::hash_combine_val_range( + seed, + pkg.defaulted_keys.begin(), + pkg.defaulted_keys.end() + ); + seed = mamba::util::hash_vals(seed, pkg.noarch, pkg.size, pkg.timestamp, pkg.package_type); + return seed; + } +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/platform.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/platform.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae708edd497f6fac8a8c8980374591f8bd46fa11 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/platform.hpp @@ -0,0 +1,267 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + + +#ifndef MAMBA_SPECS_PLATFORM_HPP +#define MAMBA_SPECS_PLATFORM_HPP + +#include +#include +#include + +#include + +namespace mamba::specs +{ + /** + * All platforms known to Conda. + * + * When one platform name is the substring of another, the longest appears first so that + * it makes it easier to use in a parser. + */ + enum class KnownPlatform + { + noarch = 0, + linux_32, + linux_64, + linux_armv6l, + linux_armv7l, + linux_aarch64, + linux_ppc64le, + linux_ppc64, + linux_s390x, + linux_riscv32, + linux_riscv64, + osx_64, + osx_arm64, + win_32, + win_64, + win_arm64, + zos_z, + + // For reflexion purposes only + count_, + }; + + using DynamicPlatform = std::string; + + [[nodiscard]] constexpr auto known_platforms_count() -> std::size_t + { + return static_cast(KnownPlatform::count_); + } + + [[nodiscard]] constexpr auto known_platforms() + -> std::array; + + [[nodiscard]] constexpr auto known_platform_names() + -> std::array; + + /** + * Convert the enumeration to its conda string. + */ + [[nodiscard]] constexpr auto platform_name(KnownPlatform p) -> std::string_view; + + /** + * Return the enum matching the platform name. + */ + [[nodiscard]] auto platform_parse(std::string_view str) -> std::optional; + + [[nodiscard]] auto platform_is_linux(KnownPlatform plat) -> bool; + [[nodiscard]] auto platform_is_linux(DynamicPlatform plat) -> bool; + + [[nodiscard]] auto platform_is_osx(KnownPlatform plat) -> bool; + [[nodiscard]] auto platform_is_osx(DynamicPlatform plat) -> bool; + + [[nodiscard]] auto platform_is_win(KnownPlatform plat) -> bool; + [[nodiscard]] auto platform_is_win(DynamicPlatform plat) -> bool; + + [[nodiscard]] auto platform_is_noarch(KnownPlatform plat) -> bool; + [[nodiscard]] auto platform_is_noarch(DynamicPlatform plat) -> bool; + + /** + * Detect the platform on which mamba was built. + */ + [[nodiscard]] auto build_platform() -> KnownPlatform; + [[nodiscard]] auto build_platform_name() -> std::string_view; + + /** + * Serialize to JSON string. + */ + void to_json(nlohmann::json& j, const KnownPlatform& p); + + /** + * Deserialize from JSON string. + */ + void from_json(const nlohmann::json& j, KnownPlatform& p); + + /** + * Noarch packages are packages that are not architecture specific. + * + * Noarch packages only have to be built once. + */ + enum struct NoArchType + { + /** Not a noarch type. */ + No, + + /** Noarch generic packages allow users to distribute docs, datasets, and source code. */ + Generic, + + /** + * A noarch python package is a python package without any precompiled python files. + * + * Normally, precompiled files (`.pyc` or `__pycache__`) are bundled with the package. + * However, these files are tied to a specific version of Python and must therefore be + * generated for every target platform and architecture. + * This complicates the build process. + * For noarch Python packages these files are generated when installing the package by + * invoking the compilation process through the python binary that is installed in the + * same environment. + * + * @see https://www.anaconda.com/blog/condas-new-noarch-packages + * @see + * https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html#noarch-python + */ + Python, + + // For reflexion purposes only + count_, + }; + + constexpr auto known_noarch_count() -> std::size_t + { + return static_cast(NoArchType::count_); + } + + constexpr auto known_noarch() -> std::array; + + constexpr auto known_noarch_names() -> std::array; + + /** + * Convert the enumeration to its conda string. + */ + constexpr auto noarch_name(NoArchType noarch) -> std::string_view; + + /** + * Return the enum matching the noarch name. + */ + auto noarch_parse(std::string_view str) -> std::optional; + + /** + * Serialize to JSON string. + */ + void to_json(nlohmann::json& j, const NoArchType& noarch); + + /** + * Deserialize from JSON string. + */ + void from_json(const nlohmann::json& j, NoArchType& noarch); + + /******************** + * Implementation * + ********************/ + + constexpr auto platform_name(KnownPlatform p) -> std::string_view + { + switch (p) + { + case KnownPlatform::noarch: + return "noarch"; + case KnownPlatform::linux_32: + return "linux-32"; + case KnownPlatform::linux_64: + return "linux-64"; + case KnownPlatform::linux_armv6l: + return "linux-armv6l"; + case KnownPlatform::linux_armv7l: + return "linux-armv7l"; + case KnownPlatform::linux_aarch64: + return "linux-aarch64"; + case KnownPlatform::linux_ppc64: + return "linux-ppc64"; + case KnownPlatform::linux_ppc64le: + return "linux-ppc64le"; + case KnownPlatform::linux_s390x: + return "linux-s390x"; + case KnownPlatform::linux_riscv32: + return "linux-riscv32"; + case KnownPlatform::linux_riscv64: + return "linux-riscv64"; + case KnownPlatform::osx_64: + return "osx-64"; + case KnownPlatform::osx_arm64: + return "osx-arm64"; + case KnownPlatform::win_32: + return "win-32"; + case KnownPlatform::win_64: + return "win-64"; + case KnownPlatform::win_arm64: + return "win-arm64"; + case KnownPlatform::zos_z: + return "zos-z"; + default: + return ""; + } + } + + constexpr auto known_platforms() -> std::array + { + auto out = std::array{}; + for (std::size_t idx = 0; idx < out.size(); ++idx) + { + out[idx] = static_cast(idx); + } + return out; + } + + constexpr auto known_platform_names() -> std::array + { + auto out = std::array{}; + auto iter = out.begin(); + for (auto p : known_platforms()) + { + *(iter++) = platform_name(p); + } + return out; + } + + constexpr auto noarch_name(NoArchType noarch) -> std::string_view + { + switch (noarch) + { + case NoArchType::No: + return "no"; + case NoArchType::Generic: + return "generic"; + case NoArchType::Python: + return "python"; + default: + return ""; + } + } + + constexpr auto known_noarch() -> std::array + { + auto out = std::array{}; + for (std::size_t idx = 0; idx < out.size(); ++idx) + { + out[idx] = static_cast(idx); + } + return out; + } + + constexpr auto known_noarch_names() -> std::array + { + auto out = std::array{}; + auto iter = out.begin(); + for (auto p : known_noarch()) + { + *(iter++) = noarch_name(p); + } + return out; + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/regex_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/regex_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..936546b5a883e9b22d8d6f27047f52212f8bbe50 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/regex_spec.hpp @@ -0,0 +1,93 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_REGEX_SPEC +#define MAMBA_SPECS_REGEX_SPEC + +#include +#include +#include + +#include +#include + +#include "mamba/specs/error.hpp" + +namespace mamba::specs +{ + /** + * A matcher for regex expression. + */ + class RegexSpec + { + public: + + inline static constexpr std::string_view free_pattern = ".*"; + inline static constexpr char pattern_start = '^'; + inline static constexpr char pattern_end = '$'; + + [[nodiscard]] static auto parse(std::string pattern) -> expected_parse_t; + + RegexSpec(); + explicit RegexSpec(std::string raw_pattern); + + [[nodiscard]] auto contains(std::string_view str) const -> bool; + + /** + * Return true if the spec will match true on any input. + */ + [[nodiscard]] auto is_explicitly_free() const -> bool; + + /** + * Return true if the spec will match exactly one input. + */ + [[nodiscard]] auto is_exact() const -> bool; + + [[nodiscard]] auto to_string() const -> const std::string&; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const RegexSpec& other) const -> bool + { + return m_raw_pattern == other.m_raw_pattern + && m_pattern.flags() == other.m_pattern.flags(); + } + + [[nodiscard]] auto operator!=(const RegexSpec& other) const -> bool + { + return !(*this == other); + } + + private: + + std::string m_raw_pattern; + std::regex m_pattern; + }; +} + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::RegexSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::RegexSpec& spec) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/repo_data.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/repo_data.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4573ed04726dc785933ea393c9a8be1d576e4808 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/repo_data.hpp @@ -0,0 +1,212 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#include +#include +#include +#include + +#include + +#include "mamba/specs/platform.hpp" +#include "mamba/specs/version.hpp" + +namespace mamba::specs +{ + + /** + * A single record in the Conda ``repodata.json``. + * + * A single record refers to a single binary distribution of a package on a Conda channel. + * + * Looking at the `RepoDataPackage` class in the Conda source code a record can also include + * the following fields but it is unclear what they do. + * - std::optional preferred_env; + * - std::optional date; + * - ? package_type + * Repodata also contains some of the following keys, although they are not parsed by Conda. + * - std::optional app_type; + * - std::optional app_entry; + * + * @see conda.models.records + * https://github.com/conda/conda/blob/main/conda/models/records.py + * @see rattler_conda_types::repo_data::PackageRecord + * https://github.com/mamba-org/rattler/blob/main/crates/rattler_conda_types/src/repo_data/mod.rs + */ + struct RepoDataPackage + { + /** The name of the package. */ + std::string name = {}; + + /** The version of the package. */ + Version version = Version(0, { { { 0 } } }); + + /** The build string of the package. */ + std::string build_string = {}; + + /** The build number of the package. */ + std::size_t build_number = {}; + + /** + * The subdirectory where the package can be found. + * + * This is likely not used as it contains not so useful strings such as "linux". + */ + std::optional subdir = {}; + + /** Optionally a MD5 hash of the package archive. */ + std::optional md5 = {}; + + /** Optionally a SHA256 hash of the package archive. */ + std::optional sha256 = {}; + + /** Optionally a path to the site-packages directory. */ + std::optional python_site_packages_path = {}; + + /** A deprecated md5 hash. */ + std::optional legacy_bz2_md5 = {}; + + /** A deprecated package archive size. */ + std::optional legacy_bz2_size = {}; + + /** Optionally the size of the package archive in bytes. */ + std::optional size = {}; + + /** Optionally the architecture the package supports. */ + std::optional arch = {}; + + /** Optionally the platform the package supports. */ + std::optional platform = {}; + + /** Specification of packages this package depends on. */ + std::vector depends = {}; + + /** + * Additional constraints on packages. + * + * `constrains` are different from `depends` in that packages specified in `depends` must + * be installed next to this package, whereas packages specified in `constrains` are not + * required to be installed, but if they are installed they must follow these constraints. + */ + std::vector constrains = {}; + + /** + * Track features are nowadays only used to deprioritize packages. + * + * To that effect, the number of track features is counted (number of commas) and the + * package is downweighted by the number of track_features. + */ + std::vector track_features = {}; + + /** + * Features are a deprecated way to specify different feature sets for the conda solver. + * + * This is not supported anymore and should not be used. + * Instead, `mutex` packages should be used to specify mutually exclusive features. + */ + std::optional features = {}; + + /** If this package is independent of architecture this field specifies in what way. */ + std::optional noarch = {}; + + /** The specific license of the package. */ + std::optional license = {}; + + /** The license family. */ + std::optional license_family = {}; + + /** + * The UNIX Epoch timestamp when this package was created. + * + * Note that sometimes this is specified in seconds and sometimes in milliseconds. + */ + std::optional timestamp = {}; + }; + + /** + * Serialize to JSON. + * + * Optional members are omitted from json. + */ + void to_json(nlohmann::json& j, const RepoDataPackage& p); + + /** + * Deserialize from JSON + * + * Missing json entries fill optionals with a null values and collections as empty. + * Special handling of the following fields is performed: + * - ``"noarch"`` can be a string or a boolean (old behaviour), in which case ``false`` + * parse to ``std::nullopt`` and ``true`` to ``NoArchType::Generic``. + * - ``"track_features"`` can be a string or list of string. In the former case, it is + * considered as a single element list. + */ + void from_json(const nlohmann::json& j, RepoDataPackage& p); + + /** Information about subdirectory of channel in the Conda RepoData. */ + struct ChannelInfo + { + /** The channel's subdirectory. */ + KnownPlatform subdir = {}; + }; + + /** Serialize to JSON. */ + void to_json(nlohmann::json& j, const ChannelInfo& info); + + /** Deserialize from JSON. */ + void from_json(const nlohmann::json& j, ChannelInfo& info); + + /** + * The repository data structure. + * + * This schema maps to the repository ``repodata.json``. + **/ + struct RepoData + { + /** The version of the repodata format. */ + std::optional version = {}; + + /** The channel information contained in the repodata.json file. + */ + std::optional info = {}; + + /** + * The tar.bz2 packages contained in the repodata.json file. + * + * Maps a filename sucha as ``libmamba-0.13.0-h3a044de_0.tar.bz2`` to its RepoDataPackage. + **/ + std::map packages = {}; + + /** + * The conda packages contained in the repodata.json file. + * + * Maps a filename such as ``libmamba-1.3.0-hcea66bb_1.conda`` to its RepoDataPackage. + * This is put under a different key for backwards compatibility with previous conda + * versions. + */ + std::map conda_packages = {}; + + /** + * Removed packages + * + * These files are still accessible, but they are not installable like regular packages. + */ + std::vector removed = {}; + }; + + /** + * Serialize to JSON. + * + * Optional members are omitted from json. + */ + void to_json(nlohmann::json& j, const RepoData& data); + + /** + * Deserialize from JSON + * + * Missing json entries fill optionals with a null values and collections as empty. + */ + void from_json(const nlohmann::json& j, RepoData& data); +} diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/unresolved_channel.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/unresolved_channel.hpp new file mode 100644 index 0000000000000000000000000000000000000000..120dcef805b0fcfef9e1fa71ff8bb500cc7e0d43 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/unresolved_channel.hpp @@ -0,0 +1,162 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_UNRESOLVED_CHANNEL_HPP +#define MAMBA_SPECS_UNRESOLVED_CHANNEL_HPP + +#include +#include +#include + +#include +#include + +#include "mamba/specs/error.hpp" +#include "mamba/specs/platform.hpp" +#include "mamba/util/flat_set.hpp" +#include "mamba/util/tuple_hash.hpp" + +namespace mamba::specs +{ + /** + * Unresolved Channel specification. + * + * This represent an unverified channel string passed by the user, or written through files. + * Due the the heavy reliance of channels on configuration options, this placeholder type + * can be used to represent channel inputs that have not been "resolved" to s specific + * location. + * This can even be true when a full URL or path is given, as some authentication information + * may come from login database. + * + * Note that for a string to be considered a URL, it must have an explicit scheme. + * So "repo.anaconda.com" is considered a name, similarly to "conda-forge" and not a URL. + * This is because otherwise it is not possible to tell names and URL apart. + */ + class UnresolvedChannel + { + public: + + enum class Type + { + /** + * A URL to a full repo structure. + * + * Example "https://repo.anaconda.com/conda-forge". + */ + URL, + /** + * A URL to a single package. + * + * Example "https://repo.anaconda.com/conda-forge/linux-64/pkg-0.0-bld.conda". + */ + PackageURL, + /** + * An (possibly implicit) path to a full repo structure. + * + * Example "/Users/name/conda-bld", "./conda-bld", "~/.conda-bld". + */ + Path, + /** + * An (possibly implicit) path to a single-package. + * + * Example "/tmp/pkg-0.0-bld.conda", "./pkg-0.0-bld.conda", "~/pkg-0.0-bld.tar.bz2". + */ + PackagePath, + /** + * A relative name. + * + * It needs to be resolved using a channel alias, or a custom channel. + * Example "conda-forge", "locals", "my-channel/my-label". + */ + Name, + /** + * An unknown channel source. + * + * It is currently unclear why it is needed. + */ + Unknown, + }; + + static constexpr std::string_view platform_separators = "|,;"; + static constexpr std::string_view unknown_channel = ""; + static constexpr std::array invalid_channels_lower = { + "", + "none:///", + "none", + ":///", + }; + + using platform_set = util::flat_set; + + [[nodiscard]] static auto parse_platform_list(std::string_view plats) -> platform_set; + + [[nodiscard]] static auto parse(std::string_view str) -> expected_parse_t; + + UnresolvedChannel() = default; + UnresolvedChannel(std::string location, platform_set filters, Type type); + + [[nodiscard]] auto type() const -> Type; + + [[nodiscard]] auto location() const& -> const std::string&; + [[nodiscard]] auto location() && -> std::string; + auto clear_location() -> std::string; + + [[nodiscard]] auto platform_filters() const& -> const platform_set&; + [[nodiscard]] auto platform_filters() && -> platform_set; + auto clear_platform_filters() -> platform_set; + + [[nodiscard]] auto is_package() const -> bool; + + [[nodiscard]] auto str() const -> std::string; + + [[nodiscard]] auto operator==(const UnresolvedChannel& other) const -> bool + { + return m_location == other.m_location // + && m_platform_filters == other.m_platform_filters // + && m_type == other.m_type; + } + + [[nodiscard]] auto operator!=(const UnresolvedChannel& other) const -> bool + { + return !(*this == other); + } + + private: + + std::string m_location = std::string(unknown_channel); + platform_set m_platform_filters = {}; + Type m_type = Type::Unknown; + }; +} + +template <> +struct fmt::formatter +{ + using UnresolvedChannel = ::mamba::specs::UnresolvedChannel; + + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const UnresolvedChannel& uc, format_context& ctx) const -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::UnresolvedChannel& uc) const -> std::size_t + { + return mamba::util::hash_vals(uc.location(), uc.platform_filters(), static_cast(uc.type())); + } +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d11e12a6a4d1323c4d70a18da9160ed3992f0273 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version.hpp @@ -0,0 +1,305 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_VERSION_HPP +#define MAMBA_SPECS_VERSION_HPP + +#include +#include +#include +#include + +#include + +#include "mamba/specs/error.hpp" +#include "mamba/util/charconv.hpp" + +namespace mamba::specs +{ + + /** + * A succession of a number and a lowercase literal. + * + * Comparison is done lexicographically, with the number first and the literal second. + * Certain literals have special meaning: + * "*" < "dev" < "_"< any other literal < "" < "post" + */ + class VersionPartAtom + { + public: + + VersionPartAtom() noexcept = default; + VersionPartAtom(std::size_t numeral) noexcept; + VersionPartAtom(std::size_t numeral, std::string_view literal); + // The use of a template is only meant to prevent ambiguous conversions + template + VersionPartAtom(std::size_t numeral, std::basic_string literal); + + [[nodiscard]] auto numeral() const noexcept -> std::size_t; + [[nodiscard]] auto literal() const& noexcept -> const std::string&; + auto literal() && noexcept -> std::string; + + [[nodiscard]] auto to_string() const -> std::string; + + private: + + // Stored in decreasing size order for performance + std::string m_literal = ""; + std::size_t m_numeral = 0; + }; + + auto operator==(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + auto operator!=(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + auto operator<(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + auto operator<=(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + auto operator>(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + auto operator>=(const VersionPartAtom& left, const VersionPartAtom& right) -> bool; + + extern template VersionPartAtom::VersionPartAtom(std::size_t, std::string); + + /** + * A sequence of VersionPartAtom meant to represent a part of a version (e.g. major, minor). + * + * In a version like ``1.3.0post1dev``, the parts are ``1``, ``3``, and ``0post1dev``. + * Version parts can have a arbitrary number of atoms, such as {0, "post"} {1, "dev"} + * in ``0post1dev``. + * + * @see Version::parse for how this is computed from strings. + * @todo Use a small vector of expected size 1 if performance ar not good enough. + */ + struct VersionPart + { + /** The atoms of the version part */ + std::vector atoms = {}; + + /** + * Whether a potential leading zero in the first atom should be considered implicit. + * + * During parsing of ``Version``, if a part starts with a literal atom, it is considered + * the same as if it started with a leading ``0``. + * For instance ``0post1dev`` is parsed in the same way as ``post1dev``. + * Marking it as implicit enables the possibility to remove it when reconstructing a string + * representation. + * This is desirable for compatibility with other version formats, such as Python, where + * a version modifier might be expressed as ``1.3.0.dev3``. + */ + bool implicit_leading_zero = false; + + VersionPart(); + VersionPart(std::initializer_list init); + VersionPart(std::vector atoms, bool implicit_leading_zero); + + [[nodiscard]] auto to_string() const -> std::string; + }; + + auto operator==(const VersionPart& left, const VersionPart& other) -> bool; + auto operator!=(const VersionPart& left, const VersionPart& other) -> bool; + auto operator<(const VersionPart& left, const VersionPart& other) -> bool; + auto operator<=(const VersionPart& left, const VersionPart& other) -> bool; + auto operator>(const VersionPart& left, const VersionPart& other) -> bool; + auto operator>=(const VersionPart& left, const VersionPart& other) -> bool; + + /** + * A sequence of VersionPart meant to represent all parts of a version. + * + * CommonVersion are composed of an arbitrary positive number parts, such as major, minor. + * They are typically separated by dots, for instance the three parts in 3.0post1dev.4 are + * {{3, ""}}, {{0, "post"}, {1, "dev"}}, and {{4, ""}}. + * + * @see Version::parse for how this is computed from strings. + * @todo Use a small vector of expected size 4 if performance ar not good enough. + */ + using CommonVersion = std::vector; + + /** + * A version according to Conda specifications. + * + * A version is composed of + * - A epoch number, usually 0; + * - A regular version, + * - An optional local. + * These elements are used to lexicographicaly compare two versions. + * + * @see https://github.com/conda/conda/blob/main/conda/models/version.py + */ + class Version + { + public: + + static constexpr char epoch_delim = '!'; + static constexpr char local_delim = '+'; + static constexpr char part_delim = '.'; + static constexpr char part_delim_alt = '-'; + static constexpr char part_delim_special = '_'; + + static auto parse(std::string_view str) -> expected_parse_t; + + /** Construct version ``0.0``. */ + Version() noexcept = default; + Version(std::size_t epoch, CommonVersion version, CommonVersion local = {}) noexcept; + + [[nodiscard]] auto epoch() const noexcept -> std::size_t; + [[nodiscard]] auto version() const noexcept -> const CommonVersion&; + [[nodiscard]] auto local() const noexcept -> const CommonVersion&; + + /** + * A string representation of the version. + * + * May not always be the same as the parsed string (due to reconstruction) but reparsing + * this string will give the same version. + * ``v == Version::parse(v.to_string())``. + */ + [[nodiscard]] auto to_string() const -> std::string; + + /** + * A string truncated of extended representation of the version. + * + * Represent the string with the desired number of parts. + * If the actual number of parts is larger, then the string is truncated. + * If the actual number of parts is smalle, then the string is expanded with zeros. + */ + [[nodiscard]] auto to_string(std::size_t level) const -> std::string; + + /** + * String representation that treats ``*`` as glob pattern. + * + * Instead of printing them as ``0*`` (as a special literal), it formats them as ``*``. + * In full, a version like ``*.1.*`` will print as such instead of ``0*.1.0*``. + */ + [[nodiscard]] auto to_string_glob() const -> std::string; + + /** + * Return true if this version starts with the other prefix. + * + * For instance 1.2.3 starts with 1.2 but not the opposite. + * Because Conda versions can contain an arbitrary number of segments, some of which + * with alpha releases, this function cannot be written as a comparison. + * One would need to comoare with a version with infinitely pre-release segments. + */ + [[nodiscard]] auto starts_with(const Version& prefix) const -> bool; + + /** + * Return true if this version is a compatible upgrade to the given one. + * + * For instance 1.3.1 is compatible with 1.2.1 at level 0 (first component `1 == 1``), + * at level 1 (second component `` 3 >= 2``), but not at level two (because the second + * component is strictly larger ``3 > 2``). + * Compatible versions are always smaller than the current version. + */ + [[nodiscard]] auto compatible_with(const Version& older, std::size_t level) const -> bool; + + private: + + // Stored in decreasing size order for performance + CommonVersion m_version = {}; + CommonVersion m_local = {}; + std::size_t m_epoch = 0; + }; + + auto operator==(const Version& left, const Version& other) -> bool; + auto operator!=(const Version& left, const Version& other) -> bool; + auto operator<(const Version& left, const Version& other) -> bool; + auto operator<=(const Version& left, const Version& other) -> bool; + auto operator>(const Version& left, const Version& other) -> bool; + auto operator>=(const Version& left, const Version& other) -> bool; + + namespace version_literals + { + auto operator""_v(const char* str, std::size_t len) -> Version; + } +} + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::VersionPartAtom atom, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct fmt::formatter +{ + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + // make sure that range is empty + if (ctx.begin() != ctx.end() && *ctx.begin() != '}') + { + throw fmt::format_error("Invalid format"); + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::VersionPart atom, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct fmt::formatter +{ + enum struct FormatType + { + Normal, + /** + * The Glob pattern, as used internally ``VersionPredicate``, lets you treat ``*`` as a + * glob pattern instead of the special character. + * It lets you format ``*.*`` as such instead of ``0*.0*``. + */ + Glob, + }; + + std::optional m_level; + FormatType m_type = FormatType::Normal; + + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + const auto end = ctx.end(); + const auto start = ctx.begin(); + + // Make sure that range is not empty + if (start == end || *start == '}') + { + return start; + } + + // Check for restricted number of segments at beginning + std::size_t val = 0; + auto [ptr, ec] = mamba::util::constexpr_from_chars(start, end, val); + if (ec == std::errc()) + { + m_level = val; + } + + // Check for end of format spec + if (ptr == end || *ptr == '}') + { + return ptr; + } + + // Check the custom format type + if (*ptr == 'g') + { + m_type = FormatType::Glob; + ++ptr; + } + + return ptr; + } + + auto format(const ::mamba::specs::Version v, format_context& ctx) const + -> format_context::iterator; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version_spec.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version_spec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f559d484dd61d9875df52a3f479a344f06c9fbae --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/specs/version_spec.hpp @@ -0,0 +1,338 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_SPECS_VERSION_SPEC_HPP +#define MAMBA_SPECS_VERSION_SPEC_HPP + +#include +#include +#include +#include + +#include + +#include "mamba/specs/error.hpp" +#include "mamba/specs/version.hpp" +#include "mamba/util/flat_bool_expr_tree.hpp" + +namespace mamba::specs +{ + /** + * A stateful unary boolean function on the Version space. + */ + class VersionPredicate + { + public: + + [[nodiscard]] static auto make_free() -> VersionPredicate; + [[nodiscard]] static auto make_equal_to(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_not_equal_to(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_greater(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_greater_equal(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_less(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_less_equal(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_starts_with(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_not_starts_with(Version ver) -> VersionPredicate; + [[nodiscard]] static auto make_compatible_with(Version ver, std::size_t level) + -> VersionPredicate; + [[nodiscard]] static auto make_version_glob(Version pattern) -> VersionPredicate; + [[nodiscard]] static auto make_not_version_glob(Version pattern) -> VersionPredicate; + + /** Construct an free interval. */ + VersionPredicate() = default; + + /** + * True if the predicate contains the given version. + */ + [[nodiscard]] auto contains(const Version& point) const -> bool; + + /** + * True if it contains a glob or negative glob expression. + * + * Does not return true for predicates that could be written as globs but are not. + */ + [[nodiscard]] auto has_glob() const -> bool; + + /** + * True if the predicate is a simple operator. + * + * Simple operators are ``=``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. + */ + [[nodiscard]] auto is_classic_operator() const -> bool; + + [[nodiscard]] auto to_string() const -> std::string; + + /** + * An alternative string representation of the version spec. + * + * Attempts to be compatible with conda-build/libsolv. + */ + [[nodiscard]] auto to_string_conda_build() const -> std::string; + + private: + + struct free_interval + { + auto operator()(const Version&, const Version&) const -> bool; + }; + + struct starts_with + { + auto operator()(const Version&, const Version&) const -> bool; + }; + + struct not_starts_with + { + auto operator()(const Version&, const Version&) const -> bool; + }; + + struct compatible_with + { + std::size_t level; + auto operator()(const Version&, const Version&) const -> bool; + }; + + struct version_glob + { + auto operator()(const Version&, const Version&) const -> bool; + }; + + struct not_version_glob + { + auto operator()(const Version&, const Version&) const -> bool; + }; + + /** + * Operator to compare with the stored version. + * + * We could store arbitrary binary operators, but since this is tightly coupled with + * ``VersionSpec`` parsing (hence not user-extensible), and performance-sensitive, + * we choose an ``std::variant`` for dynamic dispatch. + * An alternative could be a type-erased wrapper with local storage. + * + * Not alternatives (``not_starts_with``, ``not_version_glob``) could also be implemented + * as a not operator in VersionSpec rather than a predicate, but they are used often enough + * to deserve their specialization. + */ + using BinaryOperator = std::variant< + free_interval, + std::equal_to, + std::not_equal_to, + std::greater, + std::greater_equal, + std::less, + std::less_equal, + starts_with, + not_starts_with, + compatible_with, + not_version_glob, + version_glob>; + + // Originally, with only stateless operators, it made sense to have the version factored + // in this class' attributes. However, with additions of variants that use the version + // for a different meaning (version_glob, compatible_with), or not at all (free interval), + // it would make sense to move it to each individual class for better scoping (e.g. see + // this class' operator==). + Version m_version = {}; + BinaryOperator m_operator = free_interval{}; + + VersionPredicate(Version ver, BinaryOperator op); + + friend auto operator==(free_interval, free_interval) -> bool; + friend auto operator==(starts_with, starts_with) -> bool; + friend auto operator==(not_starts_with, not_starts_with) -> bool; + friend auto operator==(compatible_with, compatible_with) -> bool; + friend auto operator==(version_glob, version_glob) -> bool; + friend auto operator==(not_version_glob, not_version_glob) -> bool; + friend auto operator==(const VersionPredicate& lhs, const VersionPredicate& rhs) -> bool; + friend struct ::fmt::formatter; + }; + + auto operator==(const VersionPredicate& lhs, const VersionPredicate& rhs) -> bool; + auto operator!=(const VersionPredicate& lhs, const VersionPredicate& rhs) -> bool; + + /** + * Represent a set of versions. + * + * Internally, a VersionSpec is a binary expression tree of union (or) or intersections (and) + * of the sets represented by VersionPredicate. + * + * The VersionSpec can itself be considered a complex predicate on the space of Version. + * + * Due to the complex nature of the expression system (comutativity, associativity, etc.), there + * is no easy way to say if two VersionSpecs are equal. + */ + class VersionSpec + { + public: + + using tree_type = util::flat_bool_expr_tree; + + static constexpr char and_token = ','; + static constexpr char or_token = '|'; + static constexpr char left_parenthesis_token = '('; + static constexpr char right_parenthesis_token = ')'; + + static constexpr std::string_view preferred_free_str = "=*"; + static constexpr std::array all_free_strs = { "", "*", "=*", "==*" }; + static constexpr std::string_view starts_with_str = "="; + static constexpr std::string_view equal_str = "=="; + static constexpr std::string_view not_equal_str = "!="; + static constexpr std::string_view greater_str = ">"; + static constexpr std::string_view greater_equal_str = ">="; + static constexpr std::string_view less_str = "<"; + static constexpr std::string_view less_equal_str = "<="; + static constexpr std::string_view compatible_str = "~="; + static constexpr std::string_view glob_suffix_str = ".*"; + static constexpr std::string_view glob_pattern_str = "*"; + + [[nodiscard]] static auto parse(std::string_view str) -> expected_parse_t; + + /** + * Create a Version spec with a single predicate in the expression. + */ + [[nodiscard]] static auto from_predicate(VersionPredicate pred) -> VersionSpec; + + /** Construct VersionSpec that match all versions. */ + VersionSpec() = default; + explicit VersionSpec(tree_type&& tree) noexcept; + + /** + * Returns whether the VersionSpec is unconstrained. + * + * Due to the complex nature of VersionSpec expressions, it is not always easy to know + * whether a complex expression can be simplified to the unconstrained one. + * This functions only handles the trivial cases. + */ + [[nodiscard]] auto is_explicitly_free() const -> bool; + + /** + * True if it contains a glob or negative glob expression anywhere in the tree. + * + * Does not return true for predicates that could be written as globs but are not. + */ + [[nodiscard]] auto has_glob() const -> bool; + + /** + * True if the version spec is an expression composed of simple operators. + * + * @see VersionPredicate::is_classic_operator + */ + [[nodiscard]] auto is_classic_operator_expression() const -> bool; + + /** + * A string representation of the version spec. + * + * May not always be the same as the parsed string (due to reconstruction) but reparsing + * this string will give the same version spec. + */ + [[nodiscard]] auto to_string() const -> std::string; + + /** + * An alternative string representation of the version spec. + * + * Attempts to be compatible with conda-build/libsolv. + */ + [[nodiscard]] auto to_string_conda_build() const -> std::string; + + /** + * True if the set described by the VersionSpec contains the given version. + */ + [[nodiscard]] auto contains(const Version& point) const -> bool; + + /** + * Return the size of the boolean expression tree. + */ + [[nodiscard]] auto expression_size() const -> std::size_t; + + [[nodiscard]] auto operator==(const VersionSpec& other) const -> bool + { + return m_tree == other.m_tree; + } + + [[nodiscard]] auto operator!=(const VersionSpec& other) const -> bool + { + return !(*this == other); + } + + private: + + tree_type m_tree; + + friend struct ::fmt::formatter; + }; + + namespace version_spec_literals + { + auto operator""_vs(const char* str, std::size_t len) -> VersionSpec; + } +} + +template <> +struct fmt::formatter +{ + /** + * Change the representation of some predicates not understood by conda-build/libsolv. + */ + bool conda_build_form = false; + + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + const auto end = ctx.end(); + for (auto it = ctx.begin(); it != end; ++it) + { + if (*it == 'b') + { + conda_build_form = true; + return ++it; + } + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::VersionPredicate& pred, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct fmt::formatter +{ + /** + * Change the representation of some predicates not understood by conda-build/libsolv. + */ + bool conda_build_form = false; + + constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator + { + const auto end = ctx.end(); + for (auto it = ctx.begin(); it != end; ++it) + { + if (*it == 'b') + { + conda_build_form = true; + return ++it; + } + } + return ctx.begin(); + } + + auto format(const ::mamba::specs::VersionSpec& spec, format_context& ctx) const + -> format_context::iterator; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::VersionPredicate& pred) const -> std::size_t; +}; + +template <> +struct std::hash +{ + auto operator()(const mamba::specs::VersionSpec& spec) const -> std::size_t; +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/build.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/build.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5c0df390cc0b9e5b27e4fe0ec9e7449572ef6863 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/build.hpp @@ -0,0 +1,28 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_BUILD_HPP +#define MAMBA_UTIL_BUILD_HPP + +namespace mamba::util +{ +#if __APPLE__ || __MACH__ + inline static constexpr bool on_win = false; + inline static constexpr bool on_linux = false; + inline static constexpr bool on_mac = true; +#elif __linux__ + inline static constexpr bool on_win = false; + inline static constexpr bool on_linux = true; + inline static constexpr bool on_mac = false; +#elif _WIN32 + inline static constexpr bool on_win = true; + inline static constexpr bool on_linux = false; + inline static constexpr bool on_mac = false; +#else +#error "no supported OS detected" +#endif +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cast.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cast.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0bdc3579bbfedc294f74a2fd51521df26d053493 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cast.hpp @@ -0,0 +1,130 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_UTIL_CAST_HPP +#define MAMBA_CORE_UTIL_CAST_HPP + +#include +#include +#include +#include + +#include + +namespace mamba::util +{ + /** + * A safe cast between arithmetic types. + * + * If the conversion leads to an overflow, the cast will throw an ``std::overflow_error``. + * If the conversion to a floating point type loses precision, the cast will throw a + * ``std::runtime_error``. + */ + template + constexpr auto safe_num_cast(const From& val) -> To; + + /******************** + * Implementation * + ********************/ + + namespace detail + { + template + constexpr auto make_overflow_error(const From& val) + { + return std::overflow_error{ fmt::format( + "Value to cast ({}) is out of destination range ([{}, {}])", + val, + std::numeric_limits::lowest(), + std::numeric_limits::max() + ) }; + }; + } + + template + constexpr auto safe_num_cast(const From& val) -> To + { + static_assert(std::is_arithmetic_v); + static_assert(std::is_arithmetic_v); + + constexpr auto to_lowest = std::numeric_limits::lowest(); + constexpr auto to_max = std::numeric_limits::max(); + constexpr auto from_lowest = std::numeric_limits::lowest(); + constexpr auto from_max = std::numeric_limits::max(); + + // Handle cases of char which std::cmp_xxx does not accept. + // WARNING: Only use during comparison + constexpr auto with_char_as_int = [](auto x) + { + if constexpr (std::is_same_v) + { + return static_cast(x); + } + else + { + return x; + } + }; + + if constexpr (std::is_same_v) + { + return val; + } + else if constexpr (std::is_integral_v && std::is_integral_v) + { + if constexpr (std::cmp_less(with_char_as_int(from_lowest), with_char_as_int(to_lowest))) + { + if (std::cmp_less(with_char_as_int(val), with_char_as_int(to_lowest))) + { + throw detail::make_overflow_error(val); + } + } + + if constexpr (std::cmp_greater(with_char_as_int(from_max), with_char_as_int(to_max))) + { + if (std::cmp_greater(with_char_as_int(val), with_char_as_int(to_max))) + { + throw detail::make_overflow_error(val); + } + } + + return static_cast(val); + } + else + { + using float_type = std::common_type_t; + constexpr auto float_cast = [](const auto& x) { return static_cast(x); }; + + if constexpr (float_cast(from_lowest) < float_cast(to_lowest)) + { + if (float_cast(val) < float_cast(to_lowest)) + { + throw detail::make_overflow_error(val); + } + } + + if constexpr (float_cast(from_max) > float_cast(to_max)) + { + if (float_cast(val) > float_cast(to_max)) + { + throw detail::make_overflow_error(val); + } + } + + To cast = static_cast(val); + From cast_back = static_cast(cast); + if (cast_back != val) + { + throw std::runtime_error{ + fmt::format("Casting from {} to {} loses precision", val, cast) + }; + } + return cast; + } + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cfile.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cfile.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bdaa3d3a2481538ca49d2d36b4689e848dbeeb49 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cfile.hpp @@ -0,0 +1,70 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_CFILE_HPP +#define MAMBA_UTIL_CFILE_HPP + +#include +#include +#include + +#include + +#include "mamba/fs/filesystem.hpp" + +namespace mamba::util +{ + class CFile + { + public: + + /** + * Open a file with C API. + * + * In case of error, set the error code @p ec. + * + * @param path must have filesystem default encoding. + */ + static auto try_open( // + const fs::u8path& path, + const char* mode, + std::error_code& ec + ) -> CFile; + + static auto try_open( // + const fs::u8path& path, + const char* mode + ) -> tl::expected; + + CFile(CFile&&) = default; + auto operator=(CFile&&) -> CFile& = default; + + /** + * The destructor will flush and close the file descriptor. + * + * Like ``std::fstream``, exceptions are ignored. + * Explicitly call @ref close to get the exception. + */ + ~CFile(); + + void try_close(std::error_code& ec) noexcept; + [[nodiscard]] auto try_close() noexcept -> tl::expected; + + auto raw() noexcept -> std::FILE*; + + private: + + struct FileClose + { + void operator()(std::FILE* ptr); + }; + + std::unique_ptr m_ptr = nullptr; + + explicit CFile(std::FILE* ptr); + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/charconv.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/charconv.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0ca686d295c01d1c80b8bcb7cdb2c6906c141f20 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/charconv.hpp @@ -0,0 +1,63 @@ +// Copyright (c) 2025, Cppreference.com +// +// Distributed under the terms of the Copyright/CC-BY-SA License. +// +// The full license can be found at the address +// https://en.cppreference.com/w/Cppreference:Copyright/CC-BY-SA + +/** + * Backport of C++23 ``std::from_chars`` function as constexpr. + */ + +#ifndef MAMBA_UTIL_CHARCONV_HPP +#define MAMBA_UTIL_CHARCONV_HPP + +#include +#include +#include + +#include "mamba/util/deprecation.hpp" + +namespace mamba::util +{ + + template + MAMBA_DEPRECATED_CXX23 constexpr auto + constexpr_from_chars(const char* first, const char* last, Int& value) -> std::from_chars_result + { + static_assert( + std::is_integral_v && std::is_unsigned_v, + "Only unsigned integers supported" + ); + + constexpr auto is_digit = [](char c) -> bool { return c >= '0' && c <= '9'; }; + + if (first == last) + { + return { first, std::errc::invalid_argument }; + } + + value = 0; + auto it = first; + while (it != last && is_digit(*it)) + { + Int digit = static_cast(static_cast(*it) - '0'); + + if (value > (std::numeric_limits::max() - digit) / 10) + { + return { it, std::errc::result_out_of_range }; + } + + value = value * 10 + digit; + ++it; + } + + if (it == first) + { + return { first, std::errc::invalid_argument }; + } + + return { it, std::errc{} }; + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/conditional.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/conditional.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5db28cc4c1c90a0ceb8f503cc4e2dc568ad85392 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/conditional.hpp @@ -0,0 +1,38 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_CONDITIONAL_HPP +#define MAMBA_UTIL_CONDITIONAL_HPP + +#include + +namespace mamba::util +{ + + template + [[nodiscard]] auto if_else(bool condition, Int true_val, Int false_val) noexcept -> Int; + + /******************** + * Implementation * + ********************/ + + template + auto if_else(bool condition, Int true_val, Int false_val) noexcept -> Int + { + if constexpr (std::is_enum_v) + { + using int_t = std::underlying_type_t; + return static_cast( + if_else(condition, static_cast(true_val), static_cast(false_val)) + ); + } + else + { + return condition ? true_val : false_val; + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cryptography.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cryptography.hpp new file mode 100644 index 0000000000000000000000000000000000000000..13d5b972c9a57b41a3f07e3fe44c44666c649cef --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/cryptography.hpp @@ -0,0 +1,341 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_CRYPTOGRAPHY_HPP +#define MAMBA_UTIL_CRYPTOGRAPHY_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include "mamba/util/encoding.hpp" + +using EVP_MD_CTX = struct evp_md_ctx_st; // OpenSSL impl + +namespace mamba::util +{ + /** + * Provide high-level hashing functions over a digest hashing algorithm. + */ + template + class DigestHasher + { + public: + + using digester_type = Digester; + + inline static constexpr std::size_t bytes_size = digester_type::bytes_size; + inline static constexpr std::size_t hex_size = 2 * bytes_size; + inline static constexpr std::size_t digest_size = digester_type::digest_size; + + using bytes_array = std::array; + using hex_array = std::array; + + // TODO(C++20): use std::span + struct blob_type + { + const std::byte* data; + std::size_t size; + }; + + /** + * Hash a blob of data and write the hashed bytes to the provided output. + */ + void blob_bytes_to(blob_type blob, std::byte* out); + + /** + * Hash a blob of data and return the hashed bytes as an array. + */ + [[nodiscard]] auto blob_bytes(blob_type blob) -> bytes_array; + + /** + * Hash a blob of data and write the hashed bytes with hexadecimal encoding to the output. + */ + void blob_hex_to(blob_type blob, char* out); + + /** + * Hash a blob of data and return the hashed bytes with hexadecimal encoding as an array. + */ + [[nodiscard]] auto blob_hex(blob_type blob) -> hex_array; + + /** + * Hash a blob of data and return the hashed bytes with hexadecimal encoding as a string. + */ + [[nodiscard]] auto blob_hex_str(blob_type blob) -> std::string; + + /** + * Hash a string and write the hashed bytes to the provided output. + */ + void str_bytes_to(std::string_view data, std::byte* out); + + /** + * Hash a string and return the hashed bytes as an array. + */ + [[nodiscard]] auto str_bytes(std::string_view data) -> bytes_array; + + /** + * Hash a string and write the hashed bytes with hexadecimal encoding to the output. + */ + void str_hex_to(std::string_view data, char* out); + + /** + * Hash a string and return the hashed bytes with hexadecimal encoding as an array. + */ + [[nodiscard]] auto str_hex(std::string_view data) -> hex_array; + + /** + * Hash a string and return the hashed bytes with hexadecimal encoding as a string. + */ + [[nodiscard]] auto str_hex_str(std::string_view data) -> std::string; + + /** + * Incrementally hash a file and write the hashed bytes to the provided output. + */ + void file_bytes_to(std::ifstream& file, std::byte* out); + + /** + * Incrementally hash a file and return the hashed bytes as an array. + */ + [[nodiscard]] auto file_bytes(std::ifstream& file) -> bytes_array; + + /** + * Incrementally hash a file and write the hashed bytes with hexadecimal encoding to the + * output. + */ + void file_hex_to(std::ifstream& infile, char* out); + + /** + * Incrementally hash a file and return the hashed bytes with hexadecimal encoding as an + * array. + */ + [[nodiscard]] auto file_hex(std::ifstream& file) -> hex_array; + + /** + * Incrementally hash a file and return the hashed bytes with hexadecimal encoding as a + * string. + */ + [[nodiscard]] auto file_hex_str(std::ifstream& file) -> std::string; + + private: + + std::vector m_digest_buffer = {}; + digester_type m_digester = {}; + }; + + namespace detail + { + class EVPDigester + { + public: + + enum struct Algorithm + { + sha256, + md5 + }; + + EVPDigester(Algorithm algo); + + void digest_start(); + void digest_update(const std::byte* buffer, std::size_t count); + void digest_finalize_to(std::byte* hash); + + private: + + struct EVPContextDeleter + { + void operator()(::EVP_MD_CTX* ptr) const; + }; + + std::unique_ptr<::EVP_MD_CTX, EVPContextDeleter> m_ctx; + Algorithm m_algorithm; + }; + } + + class Sha256Digester : private detail::EVPDigester + { + public: + + inline static constexpr std::size_t bytes_size = 32; + inline static constexpr std::size_t digest_size = 32768; + + using detail::EVPDigester::digest_start; + using detail::EVPDigester::digest_update; + using detail::EVPDigester::digest_finalize_to; + + Sha256Digester() + : EVPDigester(detail::EVPDigester::Algorithm::sha256) + { + } + }; + + using Sha256Hasher = DigestHasher; + + class Md5Digester : private detail::EVPDigester + { + public: + + inline static constexpr std::size_t bytes_size = 16; + inline static constexpr std::size_t digest_size = 32768; + + using detail::EVPDigester::digest_start; + using detail::EVPDigester::digest_update; + using detail::EVPDigester::digest_finalize_to; + + Md5Digester() + : EVPDigester(detail::EVPDigester::Algorithm::md5) + { + } + }; + + using Md5Hasher = DigestHasher; + + /************************************ + * Implementation of DigestHasher * + ************************************/ + + template + void DigestHasher::blob_bytes_to(blob_type blob, std::byte* out) + { + m_digester.digest_start(); + + auto [iter, remaining] = blob; + while (remaining > 0) + { + const auto taken = std::min(remaining, digest_size); + m_digester.digest_update(const_cast(iter), taken); + remaining -= taken; + iter += taken; + } + return m_digester.digest_finalize_to(out); + } + + template + auto DigestHasher::blob_bytes(blob_type blob) -> bytes_array + { + auto out = bytes_array{}; + blob_bytes_to(blob, out.data()); + return out; + } + + template + void DigestHasher::blob_hex_to(blob_type blob, char* out) + { + // Reusing the output array to write the temporary bytes + static_assert(hex_size >= 2 * bytes_size); + static_assert(sizeof(std::byte) == sizeof(char)); + auto bytes_first = reinterpret_cast(out) + bytes_size; + auto bytes_last = bytes_first + bytes_size; + blob_bytes_to(blob, bytes_first); + bytes_to_hex_to(bytes_first, bytes_last, out); + } + + template + auto DigestHasher::blob_hex(blob_type blob) -> hex_array + { + auto out = hex_array{}; + blob_hex_to(blob, out.data()); + return out; + } + + template + auto DigestHasher::blob_hex_str(blob_type blob) -> std::string + { + auto out = std::string(hex_size, 'x'); // An invalid character + blob_hex_to(blob, out.data()); + return out; + } + + template + void DigestHasher::str_bytes_to(std::string_view data, std::byte* out) + { + blob_bytes_to({ reinterpret_cast(data.data()), data.size() }, out); + } + + template + auto DigestHasher::str_bytes(std::string_view data) -> bytes_array + { + return blob_bytes({ reinterpret_cast(data.data()), data.size() }); + } + + template + void DigestHasher::str_hex_to(std::string_view data, char* out) + { + blob_hex_to({ reinterpret_cast(data.data()), data.size() }, out); + } + + template + auto DigestHasher::str_hex(std::string_view data) -> hex_array + { + return blob_hex({ reinterpret_cast(data.data()), data.size() }); + } + + template + auto DigestHasher::str_hex_str(std::string_view data) -> std::string + { + return blob_hex_str({ reinterpret_cast(data.data()), data.size() }); + } + + template + void DigestHasher::file_bytes_to(std::ifstream& infile, std::byte* out) + { + m_digest_buffer.assign(digest_size, std::byte(0)); + m_digester.digest_start(); + + while (infile) + { + infile.read(reinterpret_cast(m_digest_buffer.data()), digest_size); + const auto count = static_cast(infile.gcount()); + if (!count) + { + break; + } + m_digester.digest_update(m_digest_buffer.data(), count); + } + return m_digester.digest_finalize_to(out); + } + + template + auto DigestHasher::file_bytes(std::ifstream& infile) -> bytes_array + { + auto out = bytes_array{}; + file_bytes_to(infile, out.data()); + return out; + } + + template + void DigestHasher::file_hex_to(std::ifstream& infile, char* out) + { + // Reusing the output array to write the temporary bytes + static_assert(hex_size >= 2 * bytes_size); + static_assert(sizeof(std::byte) == sizeof(char)); + auto bytes_first = reinterpret_cast(out) + bytes_size; + auto bytes_last = bytes_first + bytes_size; + file_bytes_to(infile, bytes_first); + bytes_to_hex_to(bytes_first, bytes_last, out); + } + + template + auto DigestHasher::file_hex(std::ifstream& infile) -> hex_array + { + auto out = hex_array{}; + file_hex_to(infile, out.data()); + return out; + } + + template + auto DigestHasher::file_hex_str(std::ifstream& infile) -> std::string + { + auto out = std::string(hex_size, 'x'); // An invalid character + file_hex_to(infile, out.data()); + return out; + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/deprecation.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/deprecation.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4d190612180b1f957291093103a5112b06725d36 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/deprecation.hpp @@ -0,0 +1,16 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_DEPRECATION_HPP +#define MAMBA_UTIL_DEPRECATION_HPP + +#if __cplusplus >= 202302L +#define MAMBA_DEPRECATED_CXX23 [[deprecated("Use C++23 functions with the same name")]] +#else +#define MAMBA_DEPRECATED_CXX23 [[]] +#endif + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/encoding.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/encoding.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0e76bdc638d757a6ec60c43cc2a1f57ebc44a6e6 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/encoding.hpp @@ -0,0 +1,127 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_ENCODING_HPP +#define MAMBA_UTIL_ENCODING_HPP + +#include +#include +#include + +#include + +namespace mamba::util +{ + enum struct EncodingError + { + Ok, + InvalidInput, + }; + + /** + * Convert the lower nibble to a hexadecimal representation. + */ + [[nodiscard]] auto nibble_to_hex(std::byte b) noexcept -> char; + + /** + * Convert a buffer of bytes to a hexadecimal string written in the @p out parameter. + * + * The @p out parameter must be allocated with twice the size of the input byte buffer. + */ + void bytes_to_hex_to(const std::byte* first, const std::byte* last, char* out) noexcept; + + /** + * Convert a buffer of bytes to a hexadecimal string. + */ + [[nodiscard]] auto bytes_to_hex_str(const std::byte* first, const std::byte* last) -> std::string; + + /** + * Convert a hexadecimal character to a lower nibble. + */ + [[nodiscard]] auto hex_to_nibble(char c, EncodingError& error) noexcept -> std::byte; + + /** + * Convert a hexadecimal character to a lower nibble. + */ + [[nodiscard]] auto hex_to_nibble(char c) noexcept -> tl::expected; + + /** + * Convert two hexadecimal characters to a byte. + */ + [[nodiscard]] auto two_hex_to_byte(char high, char low, EncodingError& error) noexcept + -> std::byte; + + /** + * Convert two hexadecimal characters to a byte. + */ + [[nodiscard]] auto two_hex_to_byte(char high, char low) noexcept + -> tl::expected; + + /** + * Convert hexadecimal characters to a bytes and write it to the given output. + * + * The number of hexadecimal characters must be even and out must be allocated with half the + * number of hexadecimal characters. + */ + void hex_to_bytes_to(std::string_view hex, std::byte* out, EncodingError& error) noexcept; + + /** + * Convert hexadecimal characters to a bytes and write it to the given output. + * + * The number of hexadecimal characters must be even and out must be allocated with half the + * number of hexadecimal characters. + */ + [[nodiscard]] auto hex_to_bytes_to(std::string_view hex, std::byte* out) noexcept + -> tl::expected; + + /** + * Escape reserved URL reserved characters with '%' encoding. + * + * The second argument can be used to specify characters to exclude from encoding, + * so that for instance path can be encoded without splitting them (if they have no '/' other + * than separators). + * + * @see url_decode + */ + [[nodiscard]] auto encode_percent(std::string_view url) -> std::string; + [[nodiscard]] auto encode_percent(std::string_view url, std::string_view exclude) -> std::string; + [[nodiscard]] auto encode_percent(std::string_view url, char exclude) -> std::string; + + /** + * Unescape percent encoded string to their URL reserved characters. + * + * @see encode_percent + */ + [[nodiscard]] auto decode_percent(std::string_view url) -> std::string; + + /** + * Convert a string to base64 encoding. + */ + [[nodiscard]] auto encode_base64(std::string_view input) + -> tl::expected; + + /** + * Convert a string from base64 back to its original representation. + */ + [[nodiscard]] auto decode_base64(std::string_view input) + -> tl::expected; + + /** + * Convert a ``std::u8string`` to a UTF-8 encoded ``std::string``. + * + * We assume here that ``char`` and ``char8_t`` are containing the same Unicode data. + */ + [[nodiscard]] auto to_utf8_std_string(std::u8string_view text) -> std::string; + + /** + * Convert a UTF-8 encoded ``std::string`` to a ``std::u8string` . + * + * We assume here that ``char`` and ``char8_t`` are containing the same Unicode data. + * No checks are made. + */ + [[nodiscard]] auto to_u8string(std::string_view text) -> std::u8string; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/environment.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/environment.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f3fc75bced665b71ddc0c66fd6137f9763fff1a8 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/environment.hpp @@ -0,0 +1,176 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_ENVIRONMENT_HPP +#define MAMBA_UTIL_ENVIRONMENT_HPP + +#include +#include +#include +#include +#include + +#include "mamba/fs/filesystem.hpp" +#include "mamba/util/build.hpp" + +namespace mamba::util +{ + /** + * Get an environment variable encoded in UTF8. + */ + [[nodiscard]] auto get_env(const std::string& key) -> std::optional; + + /** + * Set an environment variable encoded in UTF8. + */ + void set_env(const std::string& key, const std::string& value); + + /** + * Unset an environment variable encoded in UTF8. + */ + void unset_env(const std::string& key); + + using environment_map = std::unordered_map; + + /** + * Return a map of all environment variables encoded in UTF8. + * + * This is useful if one is interested to do an operation over all environment variables + * when their names are unknown. + */ + [[nodiscard]] auto get_env_map() -> environment_map; + + /** + * Equivalent to calling set_env in a loop. + * + * This leaves environment variables not referred to in the map unmodified. + */ + void update_env_map(const environment_map& env); + + /** + * Set the environment to be exactly the map given. + * + * This unsets all environment variables not referred to in the map unmodified. + */ + void set_env_map(const environment_map& env); + + /* + * Return the current user home directory. + */ + [[nodiscard]] auto user_home_dir() -> std::string; + + /** + * Return the current user config directory. + * + * On all platforms, the XDG_CONFIG_HOME environment variables are honored. + * Otherwise, it returns the OS-specified config directory on Windows, and the XDG default + * on Unix. + */ + [[nodiscard]] auto user_config_dir() -> std::string; + + /** + * Return the current user program data directory. + * + * On all platforms, the XDG_DATA_HOME environment variables are honored. + * Otherwise, it returns the OS-specified config directory on Windows, and the XDG default + * on Unix. + */ + [[nodiscard]] auto user_data_dir() -> std::string; + + /** + * Return the current user program dispensable cache directory. + * + * On all platforms, the XDG_CACHE_HOME environment variables are honored. + * Otherwise, it returns the OS-specified config directory on Windows, and the XDG default + * on Unix. + */ + [[nodiscard]] auto user_cache_dir() -> std::string; + + /** + * Return the character use to separate paths. + */ + [[nodiscard]] constexpr auto pathsep() -> char; + + /** + * Return directories of the given prefix path. + */ + [[nodiscard]] auto get_path_dirs(const fs::u8path& prefix) -> std::vector; + + /** + * Return the full path of a program from its name. + */ + [[nodiscard]] auto which(std::string_view exe) -> fs::u8path; + + /** + * Return the full path of a program from its name if found inside the given directories. + */ + template + [[nodiscard]] auto which_in(std::string_view exe, Iter search_path_first, Iter search_path_last) + -> fs::u8path; + + /** + * Return the full path of a program from its name if found inside the given directories. + * + * The directories can be given as a range or as a @ref pathsep separated list. + */ + template + [[nodiscard]] auto which_in(std::string_view exe, const Range& search_paths) -> fs::u8path; + + /******************** + * Implementation * + ********************/ + + constexpr auto pathsep() -> char + { + if (on_win) + { + return ';'; + } + else + { + return ':'; + } + } + + namespace detail + { + [[nodiscard]] auto which_in_one(const fs::u8path& exe, const fs::u8path& dir) -> fs::u8path; + + [[nodiscard]] auto which_in_split(const fs::u8path& exe, std::string_view paths) + -> fs::u8path; + } + + template + auto which_in(std::string_view exe, Iter first, Iter last) -> fs::u8path + { + for (; first != last; ++first) + { + if (auto p = detail::which_in_one(exe, *first); !p.empty()) + { + return p; + } + } + return ""; + } + + template + auto which_in(std::string_view exe, const Range& search_paths) -> fs::u8path + { + if constexpr (std::is_same_v) + { + return detail::which_in_one(exe, search_paths); + } + else if constexpr (std::is_convertible_v) + { + return detail::which_in_split(exe, search_paths); + } + else + { + return which_in(exe, search_paths.cbegin(), search_paths.cend()); + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_binary_tree.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_binary_tree.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f488cd65540138e2c67f6fad3db88335b685e299 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_binary_tree.hpp @@ -0,0 +1,299 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_FLAT_BINARY_TREE_HPP +#define MAMBA_UTIL_FLAT_BINARY_TREE_HPP + +#include +#include +#include + +namespace mamba::util +{ + /** + * In array binary tree. + * + * A binary tree, each node is either a leaf, or a node with exactly two children. + * This data structure is light and nothing prevents the user from representing + * any kind of binary directed acyclic graph (e.g. there can be multiple trees, + * or nodes could have multiple parents) + * + * For efficiency (and simplicity), this data structure can currently only grow. + * The tree must also be grown from the leaves, adding children first and their + * parents afterwards. + */ + template + class flat_binary_tree + { + public: + + using branch_type = Branch; + using leaf_type = Leaf; + + struct branch_node + { + branch_type data; + std::size_t left_child = 0; + std::size_t right_child = 0; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const branch_node& other) const -> bool + { + return data == other.data // + && left_child == other.left_child // + && right_child == other.right_child; + } + + [[nodiscard]] auto operator!=(const branch_node& other) const -> bool + { + return !(*this == other); + } + }; + + using leaf_node = leaf_type; + using node_type = std::variant; + using node_list = std::vector; + using size_type = typename node_list::size_type; + using idx_type = size_type; + + [[nodiscard]] auto size() const -> size_type; + [[nodiscard]] auto empty() const -> bool; + + /** Remove all nodes. */ + void clear(); + + /** + * Reserve (allocate) space for @p nodes. + * + * This improves the efficiency of ``add_leaf`` and ``add_branch`` but does not + * modify the tree in any way. + */ + void reserve(size_type size); + + /** + * Add a node with no children. + * + * Return an ID that can be used to point to this node as a children in ``add_branch``. + */ + auto add_leaf(const leaf_type& leaf) -> idx_type; + auto add_leaf(leaf_type&& leaf) -> idx_type; + + /** + * Add a node with exactly two children. + * + * The children must have been previously added to the tree and their IDs can be used + * to point to them. + */ + auto add_branch(const branch_type& branch, idx_type left_child, idx_type right_child) + -> idx_type; + auto add_branch(branch_type&& branch, idx_type left_child, idx_type right_child) -> idx_type; + + [[nodiscard]] auto node(idx_type idx) const -> const node_type&; + [[nodiscard]] auto node(idx_type idx) -> node_type&; + [[nodiscard]] auto is_branch(idx_type idx) const -> bool; + [[nodiscard]] auto is_leaf(idx_type idx) const -> bool; + [[nodiscard]] auto leaf(idx_type idx) const -> const leaf_type&; + [[nodiscard]] auto leaf(idx_type idx) -> leaf_type&; + [[nodiscard]] auto branch(idx_type idx) const -> const branch_type&; + [[nodiscard]] auto branch(idx_type idx) -> branch_type&; + [[nodiscard]] auto left(idx_type idx) const -> idx_type; + [[nodiscard]] auto right(idx_type idx) const -> idx_type; + [[nodiscard]] auto root() const -> idx_type; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const flat_binary_tree& other) const -> bool + { + return m_nodes == other.m_nodes && m_root == other.m_root; + } + + [[nodiscard]] auto operator!=(const flat_binary_tree& other) const -> bool + { + return !(*this == other); + } + + template + void dfs_raw(Visitor&& visitor, idx_type start) const; + + private: + + node_list m_nodes; + idx_type m_root = 0; + + template + auto add_leaf_impl(L&& leaf) -> idx_type; + template + auto add_branch_impl(B&& branch, idx_type left_child, idx_type right_child) -> idx_type; + }; + + /**************************************** + * Implementation of flat_binary_tree * + ****************************************/ + + template + auto flat_binary_tree::size() const -> size_type + { + return m_nodes.size(); + } + + template + auto flat_binary_tree::empty() const -> bool + { + return m_nodes.empty(); + } + + template + auto flat_binary_tree::node(idx_type idx) const -> const node_type& + { + return m_nodes.at(idx); + } + + template + auto flat_binary_tree::node(idx_type idx) -> node_type& + { + return m_nodes.at(idx); + } + + template + auto flat_binary_tree::is_branch(idx_type idx) const -> bool + { + return std::holds_alternative(node(idx)); + } + + template + auto flat_binary_tree::is_leaf(idx_type idx) const -> bool + { + return std::holds_alternative(node(idx)); + } + + template + auto flat_binary_tree::leaf(idx_type idx) const -> const leaf_type& + { + return std::get(node(idx)); + } + + template + auto flat_binary_tree::leaf(idx_type idx) -> leaf_type& + { + return std::get(node(idx)); + } + + template + auto flat_binary_tree::branch(idx_type idx) const -> const branch_type& + { + return std::get(node(idx)).data; + } + + template + auto flat_binary_tree::branch(idx_type idx) -> branch_type& + { + return std::get(node(idx)).data; + } + + template + auto flat_binary_tree::left(idx_type idx) const -> idx_type + { + return std::get(node(idx)).left_child; + } + + template + auto flat_binary_tree::right(idx_type idx) const -> idx_type + { + return std::get(node(idx)).right_child; + } + + template + auto flat_binary_tree::root() const -> idx_type + { + return m_root; + } + + template + void flat_binary_tree::clear() + { + return m_nodes.clear(); + } + + template + void flat_binary_tree::reserve(size_type size) + { + return m_nodes.reserve(size); + } + + template + template + auto flat_binary_tree::add_leaf_impl(Leaf&& leaf) -> idx_type + { + m_nodes.emplace_back(std::forward(leaf)); + return size() - 1; + } + + template + auto flat_binary_tree::add_leaf(const leaf_type& leaf) -> idx_type + { + return add_leaf_impl(leaf); + } + + template + auto flat_binary_tree::add_leaf(leaf_type&& leaf) -> idx_type + { + return add_leaf_impl(std::move(leaf)); + } + + template + template + auto + flat_binary_tree::add_branch_impl(Branch&& branch, idx_type left_child, idx_type right_child) + -> idx_type + { + m_nodes.emplace_back(branch_node{ std::forward(branch), left_child, right_child }); + const auto idx = size() - 1; + if ((left_child == root()) || right_child == root()) + { + m_root = idx; + } + return idx; + } + + template + auto + flat_binary_tree::add_branch(const branch_type& branch, idx_type left_child, idx_type right_child) + -> idx_type + { + return add_branch_impl(branch, left_child, right_child); + } + + template + auto + flat_binary_tree::add_branch(branch_type&& branch, idx_type left_child, idx_type right_child) + -> idx_type + { + return add_branch_impl(std::move(branch), left_child, right_child); + } + + template + template + void flat_binary_tree::dfs_raw(Visitor&& visitor, idx_type start_idx) const + { + if (is_leaf(start_idx)) + { + visitor.on_leaf(*this, start_idx); + } + else + { + const auto left_idx = left(start_idx); + const auto right_idx = right(start_idx); + + visitor.on_branch_left_before(*this, start_idx, left_idx); + dfs_raw(visitor, left_idx); + + visitor.on_branch_infix(*this, start_idx, left_idx, right_idx); + + dfs_raw(visitor, right_idx); + visitor.on_branch_right_after(*this, start_idx, right_idx); + } + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_bool_expr_tree.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_bool_expr_tree.hpp new file mode 100644 index 0000000000000000000000000000000000000000..637aff372b4e3327c5539718423900b2dd174185 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_bool_expr_tree.hpp @@ -0,0 +1,645 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_FLAT_EXPR_TREE_HPP +#define MAMBA_UTIL_FLAT_EXPR_TREE_HPP + +#include +#include +#include +#include +#include + +#include "mamba/util/flat_binary_tree.hpp" + +namespace mamba::util +{ + /** + * A parser for postfix expressions. + * + * The parser creates an expression tree and validate that the expression being pushed + * is a valid postfix expression. + * For example, for the expression ``a + b * c`` on might push ``a b c * +`` + * or ``b c * a +``. + */ + template + class PostfixParser + { + public: + + using operator_type = Operator; + using variable_type = Variable; + using tree_type = flat_binary_tree; + + [[nodiscard]] auto push_variable(const variable_type& var) -> bool; + [[nodiscard]] auto push_variable(variable_type&& var) -> bool; + [[nodiscard]] auto push_operator(const operator_type& op) -> bool; + [[nodiscard]] auto push_operator(operator_type&& op) -> bool; + [[nodiscard]] auto finalize() -> bool; + + [[nodiscard]] auto tree() const& -> const tree_type&; + [[nodiscard]] auto tree() && -> tree_type&&; + + private: + + using idx_type = typename tree_type::idx_type; + using node_idx_stack = std::vector; + + /** The expression tree containing the expression being parsed. */ + tree_type m_tree = {}; + /** Orphan nodes are node without a parent. */ + node_idx_stack m_orphans = {}; + + void orphans_push(idx_type idx); + auto orphans_pop() -> idx_type; + + template + [[nodiscard]] auto push_variable_impl(V&& var) -> bool; + template + [[nodiscard]] auto push_operator_impl(O&& op) -> bool; + }; + + /** + * A parser for infix expressions. + * + * The parser creates an expression tree and validate that the expression being pushed + * is a valid infix expression. + * For example, the expression ``a + b * c`` can be pushed directly (thanks to the + * operator precedence), or parenthesised as ``a + (b * c)``. + */ + template > + class InfixParser + { + public: + + using operator_type = Operator; + using variable_type = Variable; + using tree_type = flat_binary_tree; + using operator_precedence_type = OperatorCmp; + + InfixParser(const operator_precedence_type& cmp); + InfixParser(operator_precedence_type&& cmp = {}); + + [[nodiscard]] auto push_variable(const variable_type& var) -> bool; + [[nodiscard]] auto push_variable(variable_type&& var) -> bool; + [[nodiscard]] auto push_operator(const operator_type& op) -> bool; + [[nodiscard]] auto push_operator(operator_type&& op) -> bool; + [[nodiscard]] auto push_left_parenthesis() -> bool; + [[nodiscard]] auto push_right_parenthesis() -> bool; + [[nodiscard]] auto finalize() -> bool; + + [[nodiscard]] auto tree() const& -> const tree_type&; + [[nodiscard]] auto tree() && -> tree_type&&; + + private: + + using postfix_parser_type = PostfixParser; + + struct LeftParenthesis + { + }; + + using operator_or_parenthesis_type = std::variant; + using operator_stack_type = std::vector; + + postfix_parser_type m_postfix_parser = {}; + operator_stack_type m_op_stack = {}; + std::size_t m_parenthesis_level = 0; + bool m_expects_op = false; + operator_precedence_type m_op_cmp = {}; + + template + void stack_push(T&& elem); + auto stack_pop() -> operator_or_parenthesis_type; + [[nodiscard]] auto stack_empty() const -> bool; + auto stack_top() const -> const operator_or_parenthesis_type&; + [[nodiscard]] auto stack_top_is_parenthesis() const -> bool; + auto stack_top_is_op_with_greater_precedence_than(const operator_type&) const -> bool; + + template + [[nodiscard]] auto push_variable_impl(V&& var) -> bool; + template + [[nodiscard]] auto push_operator_impl(O&& op) -> bool; + }; + + enum struct BoolOperator + { + logical_and, + logical_or + }; + + template + class flat_bool_expr_tree + { + public: + + using self_type = flat_bool_expr_tree; + using operator_type = BoolOperator; + using variable_type = Variable; + using tree_type = flat_binary_tree; + using size_type = typename tree_type::size_type; + + struct LeftParenthesis + { + }; + + struct RightParenthesis + { + }; + + flat_bool_expr_tree() = default; + flat_bool_expr_tree(const flat_bool_expr_tree&) = default; + flat_bool_expr_tree(flat_bool_expr_tree&&) = default; + flat_bool_expr_tree(const tree_type& tree); + flat_bool_expr_tree(tree_type&& tree); + + auto operator=(const flat_bool_expr_tree&) -> flat_bool_expr_tree& = default; + auto operator=(flat_bool_expr_tree&&) -> flat_bool_expr_tree& = default; + + [[nodiscard]] auto size() const -> size_type; + [[nodiscard]] auto empty() const -> bool; + + void clear(); + void reserve(size_type size); + + template + [[nodiscard]] auto evaluate(UnaryFunc&& var_evaluator = {}, bool empty_val = true) const + -> bool; + + template + void infix_for_each(UnaryFunc&& func) const; + + // TODO(C++20): replace by the `= default` implementation of `operator==` + [[nodiscard]] auto operator==(const self_type& other) const -> bool + { + return m_tree == other.m_tree; + } + + [[nodiscard]] auto operator!=(const self_type& other) const -> bool + { + return !(*this == other); + } + + private: + + using idx_type = typename tree_type::idx_type; + + template + auto evaluate_impl(UnaryFunc& var_evaluator, idx_type idx) const -> bool; + + tree_type m_tree = {}; + }; + + template + constexpr auto operator==( + typename flat_bool_expr_tree::LeftParenthesis, + typename flat_bool_expr_tree::LeftParenthesis + ) -> bool + { + return true; + } + + template + constexpr auto operator!=( + typename flat_bool_expr_tree::LeftParenthesis, + typename flat_bool_expr_tree::LeftParenthesis + ) -> bool + { + return false; + } + + template + constexpr auto operator==( + typename flat_bool_expr_tree::RightParenthesis, + typename flat_bool_expr_tree::RightParenthesis + ) -> bool + { + return true; + } + + template + constexpr auto operator!=( + typename flat_bool_expr_tree::RightParenthesis, + typename flat_bool_expr_tree::RightParenthesis + ) -> bool + { + return false; + } + + /************************************* + * Implementation of PostfixParser * + *************************************/ + + template + void PostfixParser::orphans_push(idx_type idx) + { + return m_orphans.push_back(idx); + } + + template + auto PostfixParser::orphans_pop() -> idx_type + { + assert(!m_orphans.empty()); + auto out = m_orphans.back(); + m_orphans.pop_back(); + return out; + } + + template + template + auto PostfixParser::push_variable_impl(Var&& var) -> bool + { + orphans_push(m_tree.add_leaf(std::forward(var))); + return true; // Always valid + } + + template + auto PostfixParser::push_variable(const variable_type& var) -> bool + { + return push_variable_impl(var); + } + + template + auto PostfixParser::push_variable(variable_type&& var) -> bool + { + return push_variable_impl(std::move(var)); + } + + template + template + auto PostfixParser::push_operator_impl(Op&& op) -> bool + { + if (m_orphans.size() < 2) + { + return false; + } + const auto right = orphans_pop(); + const auto left = orphans_pop(); + orphans_push(m_tree.add_branch(std::forward(op), left, right)); + return true; + } + + template + auto PostfixParser::push_operator(const operator_type& op) -> bool + { + return push_operator_impl(op); + } + + template + auto PostfixParser::push_operator(operator_type&& op) -> bool + { + return push_operator_impl(std::move(op)); + } + + template + auto PostfixParser::finalize() -> bool + { + if (((m_orphans.size() == 1) && !m_tree.empty()) || (m_orphans.empty() && m_tree.empty())) + { + return true; + } + return false; // Incomplete expression + } + + template + auto PostfixParser::tree() const& -> const tree_type& + { + return m_tree; + } + + template + auto PostfixParser::tree() && -> tree_type&& + { + return std::move(m_tree); + } + + /*********************************** + * Implementation of InfixParser * + ***********************************/ + + template + InfixParser::InfixParser(const operator_precedence_type& cmp) + : m_op_cmp(cmp) + { + } + + template + InfixParser::InfixParser(operator_precedence_type&& cmp) + : m_op_cmp(std::move(cmp)) + { + } + + template + template + void InfixParser::stack_push(T&& elem) + { + m_op_stack.push_back(std::forward(elem)); + } + + template + auto InfixParser::stack_pop() -> operator_or_parenthesis_type + { + assert(!stack_empty()); + auto top = stack_top(); + m_op_stack.pop_back(); + return top; + } + + template + auto InfixParser::stack_empty() const -> bool + { + return m_op_stack.empty(); + } + + template + auto InfixParser::stack_top() const -> const operator_or_parenthesis_type& + { + assert(!stack_empty()); + return m_op_stack.back(); + } + + template + auto InfixParser::stack_top_is_parenthesis() const -> bool + { + return (!stack_empty()) && std::holds_alternative(stack_top()); + } + + template + auto InfixParser::stack_top_is_op_with_greater_precedence_than(const operator_type& op + ) const -> bool + { + if (stack_empty()) + { + return false; + } + if (const auto* const op_ptr = std::get_if(&stack_top())) + { + return m_op_cmp(op, *op_ptr); + } + return false; + } + + template + template + auto InfixParser::push_variable_impl(Var&& var) -> bool + { + // Input check + if (m_expects_op) + { + return false; // Unexpected variable + } + m_expects_op = true; + // Parsing + return m_postfix_parser.push_variable(std::forward(var)); + } + + template + auto InfixParser::push_variable(const variable_type& var) -> bool + { + return push_variable_impl(var); + } + + template + auto InfixParser::push_variable(variable_type&& var) -> bool + { + return push_variable_impl(std::move(var)); + } + + template + template + auto InfixParser::push_operator_impl(Op&& op) -> bool + { + // Input check + if (!m_expects_op) + { + return false; + } + m_expects_op = false; + // Parsing + while (stack_top_is_op_with_greater_precedence_than(op)) + { + bool pushed = m_postfix_parser.push_operator(std::get(stack_pop())); + if (!pushed) + { + return false; + } + } + stack_push(std::forward(op)); + return true; + } + + template + auto InfixParser::push_operator(const operator_type& op) -> bool + { + return push_operator_impl(op); + } + + template + auto InfixParser::push_operator(operator_type&& op) -> bool + { + return push_operator_impl(std::move(op)); + } + + template + auto InfixParser::push_left_parenthesis() -> bool + { + // Input check + if (m_expects_op) + { + return false; // Unexpected left parenthesis + } + ++m_parenthesis_level; + // Parsing + stack_push(LeftParenthesis{}); + return true; + } + + template + auto InfixParser::push_right_parenthesis() -> bool + { + // Input check + if (!m_expects_op || (m_parenthesis_level == 0)) + { + return false; // Unexpected right parenthesis + } + --m_parenthesis_level; + // Parsing + while (!stack_top_is_parenthesis()) + { + assert(!stack_empty()); + bool pushed = m_postfix_parser.push_operator(std::get(stack_pop())); + if (!pushed) + { + return false; + } + } + assert(stack_top_is_parenthesis()); + stack_pop(); + return true; + } + + template + auto InfixParser::finalize() -> bool + { + // Empty expression case + if (m_postfix_parser.tree().empty() && stack_empty()) + { + return true; + } + // Input check + if (!m_expects_op || (m_parenthesis_level != 0)) + { + return false; // Invalid expression + } + // Parsing + while (!stack_empty()) + { + assert(!stack_top_is_parenthesis()); + bool pushed = m_postfix_parser.push_operator(std::get(stack_pop())); + if (!pushed) + { + return false; + } + } + return m_postfix_parser.finalize(); + } + + template + auto InfixParser::tree() const& -> const tree_type& + { + return m_postfix_parser.tree(); + } + + template + auto InfixParser::tree() && -> tree_type&& + { + return std::move(m_postfix_parser).tree(); + } + + /******************************************* + * Implementation of flat_bool_expr_tree * + *******************************************/ + + template + flat_bool_expr_tree::flat_bool_expr_tree(const tree_type& tree) + : m_tree(tree) + { + } + + template + flat_bool_expr_tree::flat_bool_expr_tree(tree_type&& tree) + : m_tree(std::move(tree)) + { + } + + template + auto flat_bool_expr_tree::size() const -> size_type + { + return m_tree.size(); + } + + template + auto flat_bool_expr_tree::empty() const -> bool + { + return m_tree.empty(); + } + + template + void flat_bool_expr_tree::clear() + { + return m_tree.clear(); + } + + template + void flat_bool_expr_tree::reserve(size_type size) + { + return m_tree.reserve(size); + } + + template + template + auto flat_bool_expr_tree::evaluate(UnaryFunc&& var_evaluator, bool empty_val) const -> bool + { + if (m_tree.empty()) + { + return empty_val; + } + return evaluate_impl(var_evaluator, m_tree.root()); + } + + template + template + auto flat_bool_expr_tree::evaluate_impl(UnaryFunc& var_eval, idx_type idx) const -> bool + { + // We do a tree evaluation rather than a stack-based postfix evaluation to + // avoid evaluation sub trees thanks to operator && and || short circuiting. + assert(idx < m_tree.size()); + if (m_tree.is_leaf(idx)) + { + return var_eval(m_tree.leaf(idx)); + } + if ((m_tree.branch(idx) == BoolOperator::logical_and)) + { + return evaluate_impl(var_eval, m_tree.left(idx)) + && evaluate_impl(var_eval, m_tree.right(idx)); + } + else // BoolOperator::logical_or + { + return evaluate_impl(var_eval, m_tree.left(idx)) + || evaluate_impl(var_eval, m_tree.right(idx)); + } + } + + template + template + void flat_bool_expr_tree::infix_for_each(UnaryFunc&& func) const + { + struct TreeVisitor + { + using idx_type = typename tree_type::idx_type; + + void on_leaf(const tree_type& tree, idx_type idx) + { + m_func(tree.leaf(idx)); + } + + void on_branch_left_before(const tree_type& tree, idx_type, idx_type left_idx) + { + if (!tree.is_leaf(left_idx)) + { + m_func(LeftParenthesis{}); + } + } + + void + on_branch_infix(const tree_type& tree, idx_type branch_idx, idx_type left_idx, idx_type right_idx) + { + if (!tree.is_leaf(left_idx)) + { + m_func(RightParenthesis{}); + } + m_func(tree.branch(branch_idx)); + if (!tree.is_leaf(right_idx)) + { + m_func(LeftParenthesis{}); + } + } + + void on_branch_right_after(const tree_type& tree, idx_type, idx_type right_idx) + { + if (!tree.is_leaf(right_idx)) + { + m_func(RightParenthesis{}); + } + } + + UnaryFunc m_func; + } tree_visitor{ std::forward(func) }; + + m_tree.dfs_raw(tree_visitor, m_tree.root()); + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_set.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_set.hpp new file mode 100644 index 0000000000000000000000000000000000000000..52947a13b95fa99bd9d4a769fb6fbc1ae2f41ce3 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/flat_set.hpp @@ -0,0 +1,572 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + + +#ifndef MAMBA_UTILFLAT_SET_HPP +#define MAMBA_UTILFLAT_SET_HPP + +#include +#include +#include +#include + +#include "mamba/util/deprecation.hpp" +#include "mamba/util/tuple_hash.hpp" + +namespace mamba::util +{ + + struct sorted_unique_t + { + explicit sorted_unique_t() = default; + }; + + inline constexpr sorted_unique_t sorted_unique{}; + + /** + * A sorted vector behaving like a set. + * + * Like, ``std::set``, uniqueness is determined by using the equivalence relation. + * In imprecise terms, two objects ``a`` and ``b`` are considered equivalent if neither + * compares less than the other: ``!comp(a, b) && !comp(b, a)`` + */ + template , typename Allocator = std::allocator> + class MAMBA_DEPRECATED_CXX23 flat_set : private std::vector + { + public: + + using Base = std::vector; + using typename Base::allocator_type; + using typename Base::const_iterator; + using typename Base::const_reverse_iterator; + using typename Base::size_type; + using typename Base::value_type; + using key_compare = Compare; + using value_compare = Compare; + + using Base::cbegin; + using Base::cend; + using Base::crbegin; + using Base::crend; + + using Base::clear; + using Base::empty; + using Base::reserve; + using Base::size; + + flat_set() = default; + flat_set( + std::initializer_list il, + key_compare compare = key_compare(), + const allocator_type& alloc = allocator_type() + ); + template + flat_set( + InputIterator first, + InputIterator last, + key_compare compare = key_compare(), + const allocator_type& alloc = Allocator() + ); + template + flat_set( + sorted_unique_t, + InputIterator first, + InputIterator last, + key_compare compare = key_compare(), + const allocator_type& alloc = Allocator() + ); + flat_set(const flat_set&) = default; + flat_set(flat_set&&) = default; + explicit flat_set(std::vector&& other, key_compare compare = key_compare()); + explicit flat_set(const std::vector& other, key_compare compare = key_compare()); + + auto operator=(const flat_set&) -> flat_set& = default; + auto operator=(flat_set&&) -> flat_set& = default; + + auto key_comp() const -> const key_compare&; + + auto front() const noexcept -> const value_type&; + auto back() const noexcept -> const value_type&; + auto operator[](size_type pos) const -> const value_type&; + auto at(size_type pos) const -> const value_type&; + + auto begin() const noexcept -> const_iterator; + auto end() const noexcept -> const_iterator; + auto rbegin() const noexcept -> const_reverse_iterator; + auto rend() const noexcept -> const_reverse_iterator; + + /** Insert an element in the set. + * + * Like std::vector and unlike std::set, inserting an element invalidates iterators. + */ + auto insert(value_type&& value) -> std::pair; + auto insert(const value_type& value) -> std::pair; + template + void insert(InputIterator first, InputIterator last); + + auto erase(const_iterator pos) -> const_iterator; + auto erase(const_iterator first, const_iterator last) -> const_iterator; + auto erase(const value_type& value) -> size_type; + + template + auto contains(const T& value) const -> bool; + + private: + + key_compare m_compare; + + auto key_eq(const value_type& a, const value_type& b) const -> bool; + template + auto insert_impl(U&& value) -> std::pair; + void sort_and_remove_duplicates(); + + template + friend auto operator==(const flat_set& lhs, const flat_set& rhs) -> bool; + + template + friend auto set_union(const flat_set&, const flat_set&) + -> flat_set; + template + friend auto set_intersection(const flat_set&, const flat_set&) + -> flat_set; + template + friend auto set_difference(const flat_set&, const flat_set&) + -> flat_set; + template + friend auto set_symmetric_difference(const flat_set&, const flat_set&) + -> flat_set; + }; + + template , class Allocator = std::allocator> + flat_set(std::initializer_list, Compare = Compare(), Allocator = Allocator()) + -> flat_set; + + template < + class InputIt, + class Comp = std::less::value_type>, + class Alloc = std::allocator::value_type>> + flat_set(InputIt, InputIt, Comp = Comp(), Alloc = Alloc()) + -> flat_set::value_type, Comp, Alloc>; + + template , class Allocator = std::allocator> + flat_set(std::vector&&, Compare compare = Compare()) + -> flat_set; + + template , class Allocator = std::allocator> + flat_set(const std::vector&, Compare compare = Compare()) + -> flat_set; + + template + auto + operator==(const flat_set& lhs, const flat_set& rhs) + -> bool; + + template + auto + operator!=(const flat_set& lhs, const flat_set& rhs) + -> bool; + + template + auto set_is_disjoint_of( + const flat_set& lhs, + const flat_set& rhs + ) -> bool; + + template + auto is_subset_of( + const flat_set& lhs, + const flat_set& rhs + ) -> bool; + + template + auto is_strict_subset_of( + const flat_set& lhs, + const flat_set& rhs + ) -> bool; + + template + auto is_superset_of( + const flat_set& lhs, + const flat_set& rhs + ) -> bool; + + template + auto is_strict_superset_of( + const flat_set& lhs, + const flat_set& rhs + ) -> bool; + + template + auto set_union( // + const flat_set& lhs, + const flat_set& rhs + ) -> flat_set; + + template + auto set_intersection( + const flat_set& lhs, + const flat_set& rhs + ) -> flat_set; + + template + auto set_difference( + const flat_set& lhs, + const flat_set& rhs + ) -> flat_set; + + template + auto set_symmetric_difference( + const flat_set& lhs, + const flat_set& rhs + ) -> flat_set; + + /******************************* + * vector_set Implementation * + *******************************/ + + template + flat_set::flat_set( + std::initializer_list il, + key_compare compare, + const allocator_type& alloc + ) + : Base(std::move(il), alloc) + , m_compare(std::move(compare)) + { + sort_and_remove_duplicates(); + } + + template + template + flat_set::flat_set( + InputIterator first, + InputIterator last, + key_compare compare, + const allocator_type& alloc + ) + : Base(first, last, alloc) + , m_compare(std::move(compare)) + { + sort_and_remove_duplicates(); + } + + template + template + flat_set::flat_set( + sorted_unique_t, + InputIterator first, + InputIterator last, + key_compare compare, + const allocator_type& alloc + ) + : Base(first, last, alloc) + , m_compare(std::move(compare)) + { + } + + template + flat_set::flat_set(std::vector&& other, C compare) + : Base(std::move(other)) + , m_compare(std::move(compare)) + { + sort_and_remove_duplicates(); + } + + template + flat_set::flat_set(const std::vector& other, C compare) + : Base(std::move(other)) + , m_compare(std::move(compare)) + { + sort_and_remove_duplicates(); + } + + template + auto flat_set::key_comp() const -> const key_compare& + { + return m_compare; + } + + template + auto flat_set::front() const noexcept -> const value_type& + { + return Base::front(); + } + + template + auto flat_set::back() const noexcept -> const value_type& + { + return Base::back(); + } + + template + auto flat_set::operator[](size_type pos) const -> const value_type& + { + return Base::operator[](pos); + } + + template + auto flat_set::at(size_type pos) const -> const value_type& + { + return Base::at(pos); + } + + template + auto flat_set::begin() const noexcept -> const_iterator + { + return Base::begin(); + } + + template + auto flat_set::end() const noexcept -> const_iterator + { + return Base::end(); + } + + template + auto flat_set::rbegin() const noexcept -> const_reverse_iterator + { + return Base::rbegin(); + } + + template + auto flat_set::rend() const noexcept -> const_reverse_iterator + { + return Base::rend(); + } + + template + auto flat_set::insert(const value_type& value) -> std::pair + { + return insert_impl(value); + } + + template + auto flat_set::insert(value_type&& value) -> std::pair + { + return insert_impl(std::move(value)); + } + + template + auto flat_set::key_eq(const value_type& a, const value_type& b) const -> bool + { + return !m_compare(a, b) && !m_compare(b, a); + } + + template + void flat_set::sort_and_remove_duplicates() + { + std::sort(Base::begin(), Base::end(), m_compare); + auto is_eq = [this](const value_type& a, const value_type& b) { return key_eq(a, b); }; + Base::erase(std::unique(Base::begin(), Base::end(), is_eq), Base::end()); + } + + template + template + void flat_set::insert(InputIterator first, InputIterator last) + { + Base::insert(Base::end(), first, last); + sort_and_remove_duplicates(); + } + + template + template + auto flat_set::insert_impl(U&& value) -> std::pair + { + auto it = std::lower_bound(begin(), end(), value, m_compare); + if ((it != end()) && (key_eq(*it, value))) + { + return { it, false }; + } + it = Base::insert(it, std::forward(value)); + return { it, true }; + } + + template + auto flat_set::erase(const_iterator pos) -> const_iterator + { + // No need to sort or remove duplicates again + return Base::erase(pos); + } + + template + auto flat_set::erase(const_iterator first, const_iterator last) -> const_iterator + { + // No need to sort or remove duplicates again + return Base::erase(first, last); + } + + template + auto flat_set::erase(const value_type& value) -> size_type + { + auto it = std::lower_bound(begin(), end(), value, m_compare); + if ((it == end()) || (!(key_eq(*it, value)))) + { + return 0; + } + erase(it); + return 1; + } + + template + template + auto flat_set::contains(const T& value) const -> bool + { + return std::binary_search(begin(), end(), value); + } + + namespace detail + { + /** + * Check if two sorted range have an empty intersection. + * + * Edited from https://en.cppreference.com/w/cpp/algorithm/set_intersection + * Distributed under the terms of the Copyright/CC-BY-SA License. + * The full license can be found at the address + * https://en.cppreference.com/w/Cppreference:Copyright/CC-BY-SA + */ + template + auto + set_disjoint(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp) + -> bool + { + while (first1 != last1 && first2 != last2) + { + if (comp(*first1, *first2)) + { + ++first1; + } + else + { + if (!comp(*first2, *first1)) + { + return false; // *first1 and *first2 are equivalent. + } + ++first2; + } + } + return true; + } + } + + template + auto operator==(const flat_set& lhs, const flat_set& rhs) -> bool + { + auto is_eq = [&lhs](const auto& a, const auto& b) { return lhs.key_eq(a, b); }; + return std::equal(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), is_eq); + } + + template + auto operator!=(const flat_set& lhs, const flat_set& rhs) -> bool + { + return !(lhs == rhs); + } + + template + auto set_is_disjoint_of(const flat_set& lhs, const flat_set& rhs) -> bool + { + return detail::set_disjoint(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), lhs.key_comp()); + } + + template + auto set_is_subset_of(const flat_set& lhs, const flat_set& rhs) -> bool + { + return (lhs.size() <= rhs.size()) // For perf + && std::includes(rhs.cbegin(), rhs.cend(), lhs.cbegin(), lhs.cend(), lhs.key_comp()); + } + + template + auto set_is_strict_subset_of(const flat_set& lhs, const flat_set& rhs) -> bool + { + return (lhs.size() < rhs.size()) && set_is_subset_of(lhs, rhs); + } + + template + auto set_is_superset_of(const flat_set& lhs, const flat_set& rhs) -> bool + { + return set_is_subset_of(rhs, lhs); + } + + template + auto set_is_strict_superset_of(const flat_set& lhs, const flat_set& rhs) -> bool + { + return set_is_strict_subset_of(rhs, lhs); + } + + template + auto set_union(const flat_set& lhs, const flat_set& rhs) -> flat_set + { + auto out = flat_set(); + out.reserve(std::max(lhs.size(), rhs.size())); // lower bound + std::set_union( + lhs.cbegin(), + lhs.cend(), + rhs.cbegin(), + rhs.cend(), + std::back_inserter(static_cast::Base&>(out)), + lhs.m_compare + ); + return out; + } + + template + auto set_intersection(const flat_set& lhs, const flat_set& rhs) + -> flat_set + { + auto out = flat_set(); + std::set_intersection( + lhs.cbegin(), + lhs.cend(), + rhs.cbegin(), + rhs.cend(), + std::back_inserter(static_cast::Base&>(out)), + lhs.m_compare + ); + return out; + } + + template + auto set_difference(const flat_set& lhs, const flat_set& rhs) + -> flat_set + { + auto out = flat_set(); + std::set_difference( + lhs.cbegin(), + lhs.cend(), + rhs.cbegin(), + rhs.cend(), + std::back_inserter(static_cast::Base&>(out)), + lhs.m_compare + ); + return out; + } + + template + auto set_symmetric_difference(const flat_set& lhs, const flat_set& rhs) + -> flat_set + { + auto out = flat_set(); + std::set_symmetric_difference( + lhs.cbegin(), + lhs.cend(), + rhs.cbegin(), + rhs.cend(), + std::back_inserter(static_cast::Base&>(out)), + lhs.m_compare + ); + return out; + } +} + +template +struct std::hash> +{ + auto operator()(const mamba::util::flat_set& set) const -> std::size_t + { + return mamba::util::hash_range(set); + } +}; + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/graph.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/graph.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d608abb03d8dfb4cf0a36771b740a42825de3079 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/graph.hpp @@ -0,0 +1,814 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_GRAPH_HPP +#define MAMBA_UTIL_GRAPH_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include "flat_set.hpp" + +namespace mamba::util +{ + // Simplified implementation of a directed graph + template + class DiGraphBase + { + public: + + using node_t = Node; + using node_id = std::size_t; + using node_map = std::map; + using node_id_list = flat_set; + using adjacency_list = std::vector; + + node_id add_node(const node_t& value); + node_id add_node(node_t&& value); + bool add_edge(node_id from, node_id to); + bool remove_edge(node_id from, node_id to); + bool remove_node(node_id id); + + bool empty() const; + std::size_t number_of_nodes() const noexcept; + std::size_t number_of_edges() const noexcept; + std::size_t in_degree(node_id id) const noexcept; + std::size_t out_degree(node_id id) const noexcept; + const node_map& nodes() const; + const node_t& node(node_id id) const; + node_t& node(node_id id); + const node_id_list& successors(node_id id) const; + const adjacency_list& successors() const; + const node_id_list& predecessors(node_id id) const; + const adjacency_list& predecessors() const; + bool has_node(node_id id) const; + bool has_edge(node_id from, node_id to) const; + + // TODO C++20 better to return a range since this search cannot be interrupted from the + // visitor + template + UnaryFunc for_each_node_id(UnaryFunc func) const; + template + BinaryFunc for_each_edge_id(BinaryFunc func) const; + template + UnaryFunc for_each_leaf_id(UnaryFunc func) const; + template + UnaryFunc for_each_leaf_id_from(node_id source, UnaryFunc func) const; + template + UnaryFunc for_each_root_id(UnaryFunc func) const; + template + UnaryFunc for_each_root_id_from(node_id source, UnaryFunc func) const; + + protected: + + using derived_t = Derived; + + DiGraphBase() = default; + DiGraphBase(const DiGraphBase&) = default; + DiGraphBase(DiGraphBase&&) = default; + DiGraphBase& operator=(const DiGraphBase&) = default; + DiGraphBase& operator=(DiGraphBase&&) = default; + ~DiGraphBase() = default; + + node_id number_of_node_id() const noexcept; + + Derived& derived_cast(); + const Derived& derived_cast() const; + + private: + + template + node_id add_node_impl(V&& value); + + // Source of truth for exsising nodes + node_map m_node_map; + // May contains empty slots after `remove_node` + adjacency_list m_predecessors; + // May contains empty slots after `remove_node` + adjacency_list m_successors; + std::size_t m_number_of_edges = 0; + }; + + // TODO C++20 better to return a range since this search cannot be interrupted from the + // visitor + // TODO should let user implement reverse with a reverse view when available + template + void + dfs_raw(const Graph& graph, Visitor&& visitor, typename Graph::node_id start, bool reverse = false); + + template + void dfs_raw(const Graph& graph, Visitor&& visitor, bool reverse = false); + + template + void dfs_preorder_nodes_for_each_id( + const Graph& graph, + UnaryFunc&& func, + typename Graph::node_id start, + bool reverse = false + ); + + template + void dfs_preorder_nodes_for_each_id(const Graph& graph, UnaryFunc&& func, bool reverse = false); + + template + void dfs_postorder_nodes_for_each_id( + const Graph& graph, + UnaryFunc&& func, + typename Graph::node_id start, + bool reverse = false + ); + + template + void dfs_postorder_nodes_for_each_id(const Graph& graph, UnaryFunc&& func, bool reverse = false); + + // TODO C++20 rather than providing an empty visitor, use a concept to detect the presence + // of member function. + // @warning Inheriting publicly from this class risks calling into the empty overloaded + // function. + template + class EmptyVisitor + { + public: + + using graph_t = Graph; + using node_id = typename graph_t::node_id; + + void start_node(node_id, const graph_t&) + { + } + + void finish_node(node_id, const graph_t&) + { + } + + void start_edge(node_id, node_id, const graph_t&) + { + } + + void tree_edge(node_id, node_id, const graph_t&) + { + } + + void back_edge(node_id, node_id, const graph_t&) + { + } + + void forward_or_cross_edge(node_id, node_id, const graph_t&) + { + } + + void finish_edge(node_id, node_id, const graph_t&) + { + } + }; + + template + auto + is_reachable(const Graph& graph, typename Graph::node_id source, typename Graph::node_id target) + -> bool; + + template + void topological_sort_for_each_node_id(const Graph& graph, UnaryFunc&& func); + + template + class DiGraph : private DiGraphBase> + { + public: + + using Base = DiGraphBase>; + using typename Base::adjacency_list; + using typename Base::node_id; + using typename Base::node_id_list; + using typename Base::node_map; + using typename Base::node_t; + using edge_t = Edge; + using edge_id = std::pair; + using edge_map = std::map; + + using Base::empty; + using Base::has_edge; + using Base::has_node; + using Base::in_degree; + using Base::node; + using Base::nodes; + using Base::number_of_edges; + using Base::number_of_nodes; + using Base::out_degree; + using Base::predecessors; + using Base::successors; + + using Base::for_each_edge_id; + using Base::for_each_leaf_id; + using Base::for_each_leaf_id_from; + using Base::for_each_node_id; + using Base::for_each_root_id; + using Base::for_each_root_id_from; + + using Base::add_node; + bool add_edge(node_id from, node_id to, const edge_t& data); + bool add_edge(node_id from, node_id to, edge_t&& data); + bool remove_edge(node_id from, node_id to); + bool remove_node(node_id id); + + const edge_map& edges() const; + const edge_t& edge(node_id from, node_id to) const; + const edge_t& edge(edge_id edge) const; + edge_t& edge(node_id from, node_id to); + edge_t& edge(edge_id edge); + + private: + + friend class DiGraphBase>; // required for private CRTP + + template + bool add_edge_impl(node_id from, node_id to, T&& data); + + edge_map m_edges; + }; + + template + class DiGraph : public DiGraphBase> + { + }; + + /******************************** + * DiGraphBase Implementation * + ********************************/ + + template + bool DiGraphBase::empty() const + { + return number_of_nodes() == 0; + } + + template + auto DiGraphBase::number_of_nodes() const noexcept -> std::size_t + { + return m_node_map.size(); + } + + template + auto DiGraphBase::number_of_edges() const noexcept -> std::size_t + { + return m_number_of_edges; + } + + template + auto DiGraphBase::in_degree(node_id id) const noexcept -> std::size_t + { + return m_predecessors[id].size(); + } + + template + auto DiGraphBase::out_degree(node_id id) const noexcept -> std::size_t + { + return m_successors[id].size(); + } + + template + auto DiGraphBase::nodes() const -> const node_map& + { + return m_node_map; + } + + template + auto DiGraphBase::node(node_id id) const -> const node_t& + { + return m_node_map.at(id); + } + + template + auto DiGraphBase::node(node_id id) -> node_t& + { + return m_node_map.at(id); + } + + template + auto DiGraphBase::successors(node_id id) const -> const node_id_list& + { + return m_successors[id]; + } + + template + auto DiGraphBase::successors() const -> const adjacency_list& + { + return m_successors; + } + + template + auto DiGraphBase::predecessors(node_id id) const -> const node_id_list& + { + return m_predecessors[id]; + } + + template + auto DiGraphBase::predecessors() const -> const adjacency_list& + { + return m_predecessors; + } + + template + auto DiGraphBase::has_node(node_id id) const -> bool + { + return nodes().count(id) > 0; + } + + template + auto DiGraphBase::has_edge(node_id from, node_id to) const -> bool + { + return has_node(from) && successors(from).contains(to); + } + + template + auto DiGraphBase::add_node(const node_t& value) -> node_id + { + return add_node_impl(value); + } + + template + auto DiGraphBase::add_node(node_t&& value) -> node_id + { + return add_node_impl(std::move(value)); + } + + template + template + auto DiGraphBase::add_node_impl(V&& value) -> node_id + { + const node_id id = number_of_node_id(); + m_node_map.emplace(id, std::forward(value)); + m_successors.push_back(node_id_list()); + m_predecessors.push_back(node_id_list()); + return id; + } + + template + bool DiGraphBase::remove_node(node_id id) + { + if (!has_node(id)) + { + return false; + } + + const auto succs = successors(id); // Cannot iterate on object being modified + for (const auto& to : succs) + { + remove_edge(id, to); + } + const auto preds = predecessors(id); // Cannot iterate on object being modified + for (const auto& from : preds) + { + remove_edge(from, id); + } + m_node_map.erase(id); + + return true; + } + + template + bool DiGraphBase::add_edge(node_id from, node_id to) + { + if (has_edge(from, to)) + { + return false; + } + m_successors[from].insert(to); + m_predecessors[to].insert(from); + ++m_number_of_edges; + return true; + } + + template + bool DiGraphBase::remove_edge(node_id from, node_id to) + { + if (!has_edge(from, to)) + { + return false; + } + m_successors[from].erase(to); + m_predecessors[to].erase(from); + --m_number_of_edges; + return true; + } + + template + template + UnaryFunc DiGraphBase::for_each_node_id(UnaryFunc func) const + { + for (const auto& [i, _] : m_node_map) + { + func(i); + } + return func; + } + + template + template + BinaryFunc DiGraphBase::for_each_edge_id(BinaryFunc func) const + { + for_each_node_id( + [&](node_id i) + { + for (node_id j : successors(i)) + { + func(i, j); + } + } + ); + return func; + } + + template + template + UnaryFunc DiGraphBase::for_each_leaf_id(UnaryFunc func) const + { + for_each_node_id( + [&](node_id i) + { + if (out_degree(i) == 0) + { + func(i); + } + } + ); + return func; + } + + template + template + UnaryFunc DiGraphBase::for_each_root_id(UnaryFunc func) const + { + for_each_node_id( + [&](node_id i) + { + if (in_degree(i) == 0) + { + func(i); + } + } + ); + return func; + } + + template + template + UnaryFunc DiGraphBase::for_each_leaf_id_from(node_id source, UnaryFunc func) const + { + // Explore the directed graph starting with the given source node. + // When we explore a node with no outgoing edge, we know it is a leaf that is also a + // descendent of source. + // The pre or post order used in the node has no importance. + dfs_preorder_nodes_for_each_id( + derived_cast(), + [&](node_id n) + { + if (out_degree(n) == 0) + { + func(n); + } + }, + source + ); + return func; + } + + template + template + UnaryFunc DiGraphBase::for_each_root_id_from(node_id source, UnaryFunc func) const + { + // Explore in reverse (going in the opposite direction of the edges the directed graph + // starting with the given source node. + // When we explore a node with no incoming edge, we know it is a root that is also an + // ascendent of source. + // The pre or post order used in the node has no importance. + dfs_preorder_nodes_for_each_id( + derived_cast(), + [&](node_id n) + { + if (in_degree(n) == 0) + { + func(n); + } + }, + source, + /* reverse= */ true + ); + return func; + } + + template + auto DiGraphBase::number_of_node_id() const noexcept -> node_id + { + // Not number_of_nodes because due to remove nodes it may be larger + return m_successors.size(); + } + + template + auto DiGraphBase::derived_cast() -> derived_t& + { + return static_cast(*this); + } + + template + auto DiGraphBase::derived_cast() const -> const derived_t& + { + return static_cast(*this); + } + + /******************************* + * Algorithms implementation * + *******************************/ + + namespace detail + { + enum struct Visited + { + yes, + ongoing, + no + }; + + template + void dfs_raw_impl( + const Graph& graph, + Visitor&& visitor, + typename Graph::node_id start, + std::vector& status, + const typename Graph::adjacency_list& adjacency + ) + { + assert(status.size() == graph.successors().size()); + assert(adjacency.size() == graph.successors().size()); + assert(start < status.size()); + status[start] = Visited::ongoing; + visitor.start_node(start, graph); + for (auto child : adjacency[start]) + { + visitor.start_edge(start, child, graph); + if (status[child] == Visited::no) + { + visitor.tree_edge(start, child, graph); + dfs_raw_impl(graph, visitor, child, status, adjacency); + } + else if (status[child] == Visited::ongoing) + { + visitor.back_edge(start, child, graph); + } + else + { + visitor.forward_or_cross_edge(start, child, graph); + } + visitor.finish_edge(start, child, graph); + } + status[start] = Visited::yes; + visitor.finish_node(start, graph); + } + } + + template + void dfs_raw(const Graph& graph, Visitor&& visitor, typename Graph::node_id start, bool reverse) + { + if (!graph.empty()) + { + auto& adjacency = reverse ? graph.predecessors() : graph.successors(); + auto status = std::vector(adjacency.size(), detail::Visited::no); + detail::dfs_raw_impl(graph, std::forward(visitor), start, status, adjacency); + } + } + + template + void dfs_raw(const Graph& graph, Visitor&& visitor, bool reverse) + { + if (graph.empty()) + { + return; + } + + using node_id = typename Graph::node_id; + + auto& adjacency = reverse ? graph.predecessors() : graph.successors(); + const auto max_node_id = adjacency.size(); + auto status = std::vector(max_node_id, detail::Visited::no); + + // Iterating over all ids, which may be a super set of the valid ids since some ids + // could have been removed. + // Hence we need to check ``graph.has_node``. + for (node_id n = 0; n < max_node_id; ++n) + { + if (graph.has_node(n) && (status[n] == detail::Visited::no)) + { + detail::dfs_raw_impl(graph, std::forward(visitor), n, status, adjacency); + } + } + } + + namespace detail + { + template + class PreorderVisitor : public EmptyVisitor + { + public: + + using node_id = typename Graph::node_id; + + template + PreorderVisitor(UnaryFuncU&& func) + : m_func{ std::forward(func) } + { + } + + void start_node(node_id n, const Graph&) + { + m_func(n); + } + + private: + + UnaryFunc m_func; + }; + + template + class PostorderVisitor : public EmptyVisitor + { + public: + + using node_id = typename Graph::node_id; + + template + PostorderVisitor(UnaryFuncU&& func) + : m_func{ std::forward(func) } + { + } + + void finish_node(node_id n, const Graph&) + { + m_func(n); + } + + private: + + UnaryFunc m_func; + }; + } + + template + void dfs_preorder_nodes_for_each_id( + const Graph& graph, + UnaryFunc&& func, + typename Graph::node_id start, + bool reverse + ) + { + dfs_raw( + graph, + detail::PreorderVisitor(std::forward(func)), + start, + reverse + ); + } + + template + void dfs_preorder_nodes_for_each_id(const Graph& graph, UnaryFunc&& func, bool reverse) + { + dfs_raw(graph, detail::PreorderVisitor(std::forward(func)), reverse); + } + + template + void dfs_postorder_nodes_for_each_id( + const Graph& graph, + UnaryFunc&& func, + typename Graph::node_id start, + bool reverse + ) + { + dfs_raw( + graph, + detail::PostorderVisitor(std::forward(func)), + start, + reverse + ); + } + + template + void dfs_postorder_nodes_for_each_id(const Graph& graph, UnaryFunc&& func, bool reverse) + { + dfs_raw(graph, detail::PostorderVisitor(std::forward(func)), reverse); + } + + template + auto + is_reachable(const Graph& graph, typename Graph::node_id source, typename Graph::node_id target) + -> bool + { + struct : EmptyVisitor + { + using node_id = typename Graph::node_id; + node_id target; + bool target_visited = false; + + void start_node(node_id node, const Graph&) + { + target_visited = target_visited || (node == target); + } + } visitor{ {}, target }; + + dfs_raw(graph, visitor, source); + return visitor.target_visited; + } + + template + void topological_sort_for_each_node_id(const Graph& graph, UnaryFunc&& func) + { + dfs_postorder_nodes_for_each_id(graph, func, /* reverse= */ true); + } + + /********************************* + * DiGraph Edge Implementation * + *********************************/ + + template + bool DiGraph::add_edge(node_id from, node_id to, const edge_t& data) + { + return add_edge_impl(from, to, data); + } + + template + bool DiGraph::add_edge(node_id from, node_id to, edge_t&& data) + { + return add_edge_impl(from, to, std::move(data)); + } + + template + template + bool DiGraph::add_edge_impl(node_id from, node_id to, T&& data) + { + if (const bool added = Base::add_edge(from, to); added) + { + auto l_edge_id = std::pair(from, to); + m_edges.insert(std::pair(l_edge_id, std::forward(data))); + return true; + } + return false; + } + + template + bool DiGraph::remove_edge(node_id from, node_id to) + { + m_edges.erase({ from, to }); // No-op if edge does not exists + return Base::remove_edge(from, to); + } + + template + bool DiGraph::remove_node(node_id id) + { + // No-op if edge does not exists + for (const auto& to : successors(id)) + { + m_edges.erase({ id, to }); + } + for (const auto& from : predecessors(id)) + { + m_edges.erase({ from, id }); + } + return Base::remove_node(id); + } + + template + auto DiGraph::edges() const -> const edge_map& + { + return m_edges; + } + + template + auto DiGraph::edge(edge_id edge) const -> const edge_t& + { + return m_edges.at(edge); + } + + template + auto DiGraph::edge(node_id from, node_id to) const -> const edge_t& + { + return edge({ from, to }); + } + + template + auto DiGraph::edge(edge_id edge) -> edge_t& + { + return m_edges[edge]; + } + + template + auto DiGraph::edge(node_id from, node_id to) -> edge_t& + { + return edge({ from, to }); + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/heap_optional.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/heap_optional.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae53f82f1a916f1310e9fe6343f61121dd234916 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/heap_optional.hpp @@ -0,0 +1,254 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_HEAP_OPTIONAL_HPP +#define MAMBA_UTIL_HEAP_OPTIONAL_HPP + +#include +#include +#include + +namespace mamba::util +{ + /** + * An optional akin to ``std::optional`` but uses heap-allocated storage. + * + * This is useful for large unlikely data, akin to ``std::unique_ptr`` but also + * provides copy semantics. + */ + template + class heap_optional + { + public: + + using element_type = T; + using const_element_type = const element_type; + using reference_type = element_type&; + using const_reference_type = const_element_type&; + using right_reference_type = element_type&&; + using pointer_type = element_type*; + using const_pointer_type = element_type*; + + heap_optional() = default; + heap_optional(std::nullopt_t); + heap_optional(const heap_optional&); + heap_optional(heap_optional&&) noexcept = default; + explicit heap_optional(element_type&& obj); + explicit heap_optional(const element_type& obj); + + auto operator=(const heap_optional&) -> heap_optional&; + auto operator=(heap_optional&&) noexcept -> heap_optional& = default; + + [[nodiscard]] auto get() noexcept -> pointer_type; + [[nodiscard]] auto get() const noexcept -> const_pointer_type; + + [[nodiscard]] auto operator*() const -> const_reference_type; + [[nodiscard]] auto operator*() -> reference_type; + + [[nodiscard]] auto operator->() const noexcept -> const_pointer_type; + [[nodiscard]] auto operator->() noexcept -> pointer_type; + + [[nodiscard]] auto has_value() const noexcept -> bool; + [[nodiscard]] explicit operator bool() const noexcept; + + [[nodiscard]] auto value() & -> reference_type; + [[nodiscard]] auto value() const& -> const_reference_type; + [[nodiscard]] auto value() && -> right_reference_type; + + template + [[nodiscard]] auto value_or(U&& other) const& -> element_type; + template + [[nodiscard]] auto value_or(U&& other) && -> element_type; + + template + auto emplace(Args&&... args) -> reference_type; + + void reset(); + + [[nodiscard]] auto operator==(const heap_optional& other) const -> bool + { + if (has_value() && other.has_value()) + { + return *m_ptr == *other; + } + return !has_value() && !other.has_value(); + } + + [[nodiscard]] auto operator!=(const heap_optional& other) const -> bool + { + return !(*this == other); + } + + private: + + std::unique_ptr m_ptr = nullptr; + }; + + template + heap_optional(T&&) -> heap_optional; + template + heap_optional(const T&) -> heap_optional; + + /************************************* + * Implementation of heap_optional * + *************************************/ + + template + heap_optional::heap_optional(std::nullopt_t) + { + } + + template + heap_optional::heap_optional(element_type&& obj) + : m_ptr(std::make_unique(std::move(obj))) + { + } + + template + heap_optional::heap_optional(const element_type& obj) + : m_ptr(std::make_unique(obj)) + { + } + + template + heap_optional::heap_optional(const heap_optional& other) + { + if (other.has_value()) + { + m_ptr = std::make_unique(*other); + } + } + + template + auto heap_optional::operator=(const heap_optional& other) -> heap_optional& + { + if (other.has_value()) + { + m_ptr = std::make_unique(*other); + } + else + { + m_ptr = nullptr; + } + return *this; + } + + template + auto heap_optional::get() noexcept -> pointer_type + { + return m_ptr.get(); + } + + template + auto heap_optional::get() const noexcept -> const_pointer_type + { + return m_ptr.get(); + } + + template + auto heap_optional::operator*() const -> const_reference_type + { + return *m_ptr; + } + + template + auto heap_optional::operator*() -> reference_type + { + return *m_ptr; + } + + template + auto heap_optional::operator->() const noexcept -> const_pointer_type + { + return m_ptr.get(); + } + + template + auto heap_optional::operator->() noexcept -> pointer_type + { + return m_ptr.get(); + } + + template + auto heap_optional::has_value() const noexcept -> bool + { + return m_ptr != nullptr; + } + + template + heap_optional::operator bool() const noexcept + { + return has_value(); + } + + template + auto heap_optional::value() & -> reference_type + { + if (has_value()) + { + return *m_ptr; + } + throw std::bad_optional_access(); + } + + template + auto heap_optional::value() const& -> const_reference_type + { + if (has_value()) + { + return *m_ptr; + } + throw std::bad_optional_access(); + } + + template + auto heap_optional::value() && -> right_reference_type + { + if (has_value()) + { + return std::move(*m_ptr); + } + throw std::bad_optional_access(); + } + + template + template + auto heap_optional::value_or(U&& other) const& -> element_type + { + if (has_value()) + { + return *m_ptr; + } + return static_cast(std::forward(other)); + } + + template + template + auto heap_optional::value_or(U&& other) && -> element_type + { + if (has_value()) + { + return std::move(*m_ptr); + } + return static_cast(std::forward(other)); + } + + template + template + auto heap_optional::emplace(Args&&... args) -> reference_type + { + m_ptr = std::make_unique(std::forward(args)...); + return *m_ptr; + } + + template + void heap_optional::reset() + { + m_ptr = nullptr; + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/iterator.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/iterator.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3baaba3f4afb99f0592c451386ac7b64dd8333f6 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/iterator.hpp @@ -0,0 +1,530 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_ITERATOR_HPP +#define MAMBA_UTIL_ITERATOR_HPP + +#include +#include +#include +#include + +namespace mamba::util +{ + /******************************** + * class xforward_iterator_base * + ********************************/ + + template + class xforward_iterator_base + { + public: + + using derived_type = I; + using value_type = T; + using reference = R; + using pointer = P; + using difference_type = D; + using iterator_category = std::forward_iterator_tag; + + friend derived_type operator++(derived_type& d, int) + { + derived_type tmp(d); + ++d; + return tmp; + } + + friend bool operator!=(const derived_type& lhs, const derived_type& rhs) + { + return !(lhs == rhs); + } + }; + + template + using xforward_iterator_base_from_traits = xforward_iterator_base< + Iterator, + typename Traits::value_type, + typename Traits::difference_type, + typename Traits::pointer, + typename Traits::reference>; + + /************************************** + * class xbidirectional_iterator_base * + **************************************/ + + template + class xbidirectional_iterator_base : public xforward_iterator_base + { + public: + + using derived_type = I; + using value_type = T; + using reference = R; + using pointer = P; + using difference_type = D; + using iterator_category = std::bidirectional_iterator_tag; + + friend derived_type operator--(derived_type& d, int) + { + derived_type tmp(d); + --d; + return tmp; + } + }; + + template + using xbidirectional_iterator_base_from_traits = xbidirectional_iterator_base< + Iterator, + typename Traits::value_type, + typename Traits::difference_type, + typename Traits::pointer, + typename Traits::reference>; + + /******************************** + * xrandom_access_iterator_base * + ********************************/ + + template + class xrandom_access_iterator_base : public xbidirectional_iterator_base + { + public: + + using derived_type = I; + using value_type = T; + using reference = R; + using pointer = P; + using difference_type = D; + using iterator_category = std::random_access_iterator_tag; + + reference operator[](difference_type n) const + { + return *(*static_cast(this) + n); + } + + friend derived_type operator+(const derived_type& it, difference_type n) + { + derived_type tmp(it); + return tmp += n; + } + + friend derived_type operator+(difference_type n, const derived_type& it) + { + derived_type tmp(it); + return tmp += n; + } + + friend derived_type operator-(const derived_type& it, difference_type n) + { + derived_type tmp(it); + return tmp -= n; + } + + friend bool operator<=(const derived_type& lhs, const derived_type& rhs) + { + return !(rhs < lhs); + } + + friend bool operator>=(const derived_type& lhs, const derived_type& rhs) + { + return !(lhs < rhs); + } + + friend bool operator>(const derived_type& lhs, const derived_type& rhs) + { + return rhs < lhs; + } + }; + + template + using xrandom_access_iterator_base_from_traits = xrandom_access_iterator_base< + Iterator, + typename Traits::value_type, + typename Traits::difference_type, + typename Traits::pointer, + typename Traits::reference>; + + /************************ + * select_iterator_base * + ************************/ + + namespace detail + { + template + using iterator_category_t = typename std::iterator_traits::iterator_category; + + template + using is_random_access_iterator = std:: + is_same, std::random_access_iterator_tag>; + + template + inline constexpr bool is_random_access_iterator_v = is_random_access_iterator::value; + + template + using is_bidirectional_iterator = std::disjunction< + std::is_same, std::bidirectional_iterator_tag>, + is_random_access_iterator>; + + template + inline constexpr bool is_bidirectional_iterator_v = is_bidirectional_iterator::value; + } + + template + struct select_iterator_base + { + template + using type = std::conditional_t< + detail::is_random_access_iterator_v, + xrandom_access_iterator_base, + std::conditional_t< + detail::is_bidirectional_iterator_v, + xbidirectional_iterator_base, + xforward_iterator_base>>; + + template + using from_traits = std::conditional_t< + detail::is_random_access_iterator_v, + xrandom_access_iterator_base_from_traits, + std::conditional_t< + detail::is_bidirectional_iterator_v, + xbidirectional_iterator_base_from_traits, + xforward_iterator_base_from_traits>>; + }; + + template + using enable_bidirectional_iterator = std::enable_if_t, R>; + + template + using enable_random_access_iterator = std::enable_if_t, R>; + + /******************* + * filter_iterator * + *******************/ + + template + class filter_iterator; + + template + struct select_filter_iterator_base + { + using type = typename select_iterator_base:: + template from_traits, std::iterator_traits>; + }; + + template + using select_filter_iterator_base_t = typename select_filter_iterator_base::type; + + template + class filter_iterator : public select_filter_iterator_base_t + { + public: + + using self_type = filter_iterator; + using base_type = select_filter_iterator_base_t; + + using reference = typename base_type::reference; + using pointer = typename base_type::pointer; + using difference_type = typename base_type::difference_type; + using iterator_category = typename base_type::iterator_category; + + filter_iterator() = default; + + filter_iterator(Iterator iter, Iterator begin, Iterator end) + : m_pred() + , m_iter(iter) + , m_begin_limit(begin) + , m_end(end) + { + if constexpr (detail::is_bidirectional_iterator::value) + { + --m_begin_limit; + } + next_valid_iterator(); + } + + template + filter_iterator(Pred&& pred, Iterator iter, Iterator begin, Iterator end) + : m_pred(std::forward(pred)) + , m_iter(iter) + , m_begin_limit(begin) + , m_end(end) + { + next_valid_iterator(); + } + + ~filter_iterator() = default; + filter_iterator(const filter_iterator&) = default; + filter_iterator(filter_iterator&&) = default; + + self_type& operator=(const self_type& rhs) + { + m_pred.reset(); + if (rhs.m_pred) + { + m_pred.emplace(*(rhs.m_pred)); + } + m_iter = rhs.m_iter; + m_begin_limit = rhs.m_begin_limit; + m_end = rhs.m_end; + return *this; + } + + self_type& operator=(self_type&& rhs) + { + m_pred.reset(); + if (rhs.m_pred) + { + m_pred.emplace(*std::move(rhs.m_pred)); + } + m_iter = std::move(rhs.m_iter); + m_begin_limit = std::move(rhs.m_begin_limit); + m_end = std::move(rhs.m_end); + return *this; + } + + self_type& operator++() + { + ++m_iter; + next_valid_iterator(); + return *this; + } + + template + enable_bidirectional_iterator operator--() + { + --m_iter; + while (m_iter != m_begin_limit && !(m_pred.value()(*m_iter))) + { + --m_iter; + } + return *this; + } + + template + enable_random_access_iterator operator+=(difference_type n) + { + advance(n); + return *this; + } + + template + enable_random_access_iterator operator-=(difference_type n) + { + advance(-n); + return *this; + } + + template + enable_random_access_iterator operator-(const It& rhs) const + { + It tmp = rhs; + difference_type res = 0; + while (tmp++ != *this) + { + ++res; + } + return res; + } + + reference operator*() const + { + return *m_iter; + } + + pointer operator->() const + { + return m_iter.operator->(); + } + + friend bool operator==(const self_type& lhs, const self_type& rhs) + { + return lhs.m_iter == rhs.m_iter; + } + + template + friend enable_random_access_iterator + operator<(const self_type& lhs, const self_type& rhs) + { + return lhs.m_iter < rhs.m_iter; + } + + private: + + void advance(difference_type n) + { + while (m_iter != m_end && n > 0) + { + ++(*this); + --n; + } + while (m_iter != m_begin_limit && n < 0) + { + --(*this); + ++n; + } + } + + void next_valid_iterator() + { + while (m_iter != m_end && !(m_pred.value()(*m_iter))) + { + ++m_iter; + } + } + + // Trick to enable move and copy assignment: since lambdas are + // not assignable, we encapsulate them in an std::optional and + // rely on it to implement assignment operators. The optional + // should be replaced with a dedicated wrapper. + std::optional m_pred; + Iterator m_iter; + Iterator m_begin_limit; + Iterator m_end; + }; + + // TODO: move the following to a dedicated file if we code new ranges type + // objects in the future. + + /********** + * filter * + **********/ + + template + class filter + { + public: + + using range_iterator = decltype(std::declval().begin()); + using const_range_iterator = decltype(std::declval().cbegin()); + using iterator = filter_iterator, range_iterator>; + using const_iterator = filter_iterator, const_range_iterator>; + + filter(Range& range, Predicate pred) + : m_range(range) + , m_pred(pred) + { + } + + iterator begin() + { + build_cache(m_first, m_range.get().begin(), m_range.get().begin(), m_range.get().end()); + return m_first.value(); + } + + iterator end() + { + build_cache(m_last, m_range.get().end(), m_range.get().begin(), m_range.get().end()); + return m_last.value(); + } + + const_iterator begin() const + { + return cbegin(); + } + + const_iterator end() const + { + return cend(); + } + + const_iterator cbegin() const + { + build_cache( + m_const_first, + m_range.get().cbegin(), + m_range.get().cbegin(), + m_range.get().cend() + ); + return m_const_first.value(); + } + + const_iterator cend() const + { + build_cache(m_const_last, m_range.get().cend(), m_range.get().cbegin(), m_range.get().cend()); + return m_const_last.value(); + } + + private: + + template + void build_cache(std::optional& iter, I pos, I first, I last) const + { + if (!iter) + { + iter = FI(m_pred, pos, first, last); + } + } + + std::reference_wrapper m_range; + Predicate m_pred; + mutable std::optional m_first; + mutable std::optional m_last; + mutable std::optional m_const_first; + mutable std::optional m_const_last; + }; + + /************* + * view::all * + *************/ + + namespace view + { + template + class range_all + { + public: + + using iterator = decltype(std::declval().begin()); + using const_iterator = decltype(std::declval().cbegin()); + + explicit range_all(Range& range) + : m_range(range) + { + } + + iterator begin() + { + return m_range.get().begin(); + } + + iterator end() + { + return m_range.get().end(); + } + + const_iterator begin() const + { + return cbegin(); + } + + const_iterator end() const + { + return cend(); + } + + const_iterator cbegin() const + { + return m_range.get().cbegin(); + } + + const_iterator cend() const + { + return m_range.get().cend(); + } + + private: + + std::reference_wrapper m_range; + }; + + template + range_all all(R& r) + { + return range_all(r); + } + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/json.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/json.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bf58c43fb4ef234e1c57a02504a2eca54e2be47e --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/json.hpp @@ -0,0 +1,61 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_JSON_HPP +#define MAMBA_UTIL_JSON_HPP + + +#include + +NLOHMANN_JSON_NAMESPACE_BEGIN + +template +struct adl_serializer> +{ + static void to_json(json& j, const std::optional& opt) + { + if (opt.has_value()) + { + j = opt.value(); + } + else + { + j = nullptr; + } + } + + static void from_json(const json& j, std::optional& opt) + { + if (!j.is_null()) + { + opt = j.template get(); + } + else + { + opt = std::nullopt; + } + } +}; + +NLOHMANN_JSON_NAMESPACE_END + +namespace mamba::util +{ + template + void deserialize_maybe_missing(Json&& j, const char (&name)[N], T& t) + { + if (j.contains(name)) + { + t = std::forward(j)[name].template get(); + } + else + { + t = {}; + } + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/loop_control.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/loop_control.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bad5996b28c46a34c19afb7f2cca6123a63d3dd1 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/loop_control.hpp @@ -0,0 +1,21 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_LOOP_CONTROL_HPP +#define MAMBA_UTIL_LOOP_CONTROL_HPP + +namespace mamba::util +{ + /** + * An enum for breaking out of ``for_each`` loops, used as a poor man range. + */ + enum class LoopControl + { + Break, + Continue, + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os.hpp new file mode 100644 index 0000000000000000000000000000000000000000..09621b926dabf9de379ddec8b2a9eefbfb2bac7e --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os.hpp @@ -0,0 +1,19 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_OS_HPP +#define MAMBA_UTIL_OS_HPP + +#include + +namespace mamba::util +{ + struct OSError + { + std::string message = {}; + }; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_linux.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_linux.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d602a44f7828911f4cf537a9ac67df1e27c91768 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_linux.hpp @@ -0,0 +1,20 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_OS_LINUX_HPP +#define MAMBA_UTIL_OS_LINUX_HPP + +#include + +#include + +#include "mamba/util/os.hpp" + +namespace mamba::util +{ + [[nodiscard]] auto linux_version() -> tl::expected; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_osx.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_osx.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1f3cba1b0c47e2512f6eb01658244656d2815c53 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_osx.hpp @@ -0,0 +1,20 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_OS_OSX_HPP +#define MAMBA_UTIL_OS_OSX_HPP + +#include + +#include + +#include "mamba/util/os.hpp" + +namespace mamba::util +{ + [[nodiscard]] auto osx_version() -> tl::expected; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_unix.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_unix.hpp new file mode 100644 index 0000000000000000000000000000000000000000..89729cae6af3e817f91092e7c88f65fbc2edec2c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_unix.hpp @@ -0,0 +1,22 @@ +// Copyright (c) 2024, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_OS_UNIX_HPP +#define MAMBA_UTIL_OS_UNIX_HPP + +#include +#include + +#include + +#include "mamba/util/os.hpp" + +namespace mamba::util +{ + [[nodiscard]] auto unix_name_version() + -> tl::expected, OSError>; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_win.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_win.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0f68e0fcc434748c286089c7b9f0edd7ea9aaabd --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/os_win.hpp @@ -0,0 +1,37 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_OS_WIN_HPP +#define MAMBA_UTIL_OS_WIN_HPP + +#include +#include + +#include + +#include "mamba/util/os.hpp" + +namespace mamba::util +{ + enum class WindowsKnowUserFolder + { + Documents, + Profile, + Programs, + ProgramData, + LocalAppData, + RoamingAppData, + }; + + [[nodiscard]] auto get_windows_known_user_folder(WindowsKnowUserFolder dir) -> std::string; + + [[nodiscard]] auto utf8_to_windows_encoding(const std::string_view utf8_text) -> std::wstring; + + [[nodiscard]] auto windows_encoding_to_utf8(std::wstring_view) -> std::string; + + [[nodiscard]] auto windows_version() -> tl::expected; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/parsers.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/parsers.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8cfe6ab0543686dc6fabd0dc5865df8665908309 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/parsers.hpp @@ -0,0 +1,688 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_PARSERS_HPP +#define MAMBA_UTIL_PARSERS_HPP + +#include +#include + +#include + +#include "mamba/util/conditional.hpp" +#include "mamba/util/string.hpp" + +namespace mamba::util +{ + + enum struct ParseError : bool + { + Ok = true, + InvalidInput = false, + }; + + /** + * Find the first opening parenthesis and its matching pair. + * + * Correctly matches parentheses together so that inner parentheses pairs are skipped. + * Open and closing pairs don't need to be different. + * If an error is encountered, @p err is modified to contain the error, otherwise it is left + * as it is. + */ + auto find_matching_parentheses( // + std::string_view text, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::pair; + + [[nodiscard]] auto find_matching_parentheses( // + std::string_view text, + char open = '(', + char close = ')' + ) noexcept -> tl::expected, ParseError>; + + template + auto find_matching_parentheses( // + std::string_view text, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::pair; + + template + [[nodiscard]] auto find_matching_parentheses( // + std::string_view text, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected, ParseError>; + + /** + * Find the last closing parenthesese and its matching pair. + * + * Correctly matches parenteses together so that inner parentheses pairs are skipped. + * Open and closing pairs don't need to be different. + * If an error is encountered, @p err is modified to contain the error, otherwise it is left + * as it is. + */ + auto rfind_matching_parentheses( // + std::string_view text, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::pair; + + [[nodiscard]] auto rfind_matching_parentheses( // + std::string_view text, + char open = '(', + char close = ')' + ) noexcept -> tl::expected, ParseError>; + + template + auto rfind_matching_parentheses( // + std::string_view text, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::pair; + + template + [[nodiscard]] auto rfind_matching_parentheses( // + std::string_view text, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected, ParseError>; + + /** + * Find a character or string, except in matching parentheses pairs. + * + * Find the first occurrence of the given character, except if such character is inside a valid + * pair of parentheses. + * Open and closing pairs don't need to be different. + * If not found, ``std::string_view::npos`` is returned but no error is set as this is not + * considered an error. + * Due to a greedy approach, the function may not be able to detect all errors, but will be + * correct when parentheses are correctly matched. + */ + auto find_not_in_parentheses( // + std::string_view text, + char c, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::size_t; + + [[nodiscard]] auto find_not_in_parentheses( // + std::string_view text, + char c, + char open = '(', + char close = ')' + ) noexcept -> tl::expected; + + template + auto find_not_in_parentheses( + std::string_view text, + char c, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::size_t; + + template + [[nodiscard]] auto find_not_in_parentheses( + std::string_view text, + char c, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected; + + auto find_not_in_parentheses( // + std::string_view text, + std::string_view val, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::size_t; + + [[nodiscard]] auto find_not_in_parentheses( // + std::string_view text, + std::string_view val, + char open = '(', + char close = ')' + ) noexcept -> tl::expected; + + template + auto find_not_in_parentheses( + std::string_view text, + std::string_view val, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::size_t; + + template + [[nodiscard]] auto find_not_in_parentheses( + std::string_view text, + std::string_view val, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected; + + /** + * Find the last character or string, except in matching parentheses pairs. + * + * Find the last occurrence of the given character, except if such character is inside a valid + * pair of parentheses. + * Open and closing pairs don't need to be different. + * If not found, ``std::string_view::npos`` is returned but no error is set as this is not + * considered an error. + * Due to a greedy approach, the function may not be able to detect all errors, but will be + * correct when parentheses are correctly matched. + */ + auto rfind_not_in_parentheses( // + std::string_view text, + char c, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::size_t; + + [[nodiscard]] auto rfind_not_in_parentheses( // + std::string_view text, + char c, + char open = '(', + char close = ')' + ) noexcept -> tl::expected; + + template + auto rfind_not_in_parentheses( + std::string_view text, + char c, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::size_t; + + template + [[nodiscard]] auto rfind_not_in_parentheses( + std::string_view text, + char c, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected; + + auto rfind_not_in_parentheses( // + std::string_view text, + std::string_view val, + ParseError& err, + char open = '(', + char close = ')' + ) noexcept -> std::size_t; + + [[nodiscard]] auto rfind_not_in_parentheses( // + std::string_view text, + std::string_view val, + char open = '(', + char close = ')' + ) noexcept -> tl::expected; + + template + auto rfind_not_in_parentheses( + std::string_view text, + std::string_view val, + ParseError& err, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> std::size_t; + + template + [[nodiscard]] auto rfind_not_in_parentheses( + std::string_view text, + std::string_view val, + const std::array& open = { '(', '[' }, + const std::array& close = { ')', ']' } + ) noexcept -> tl::expected; + + /** + * Test whether the glob pattern @p pattern matches the string @p str. + */ + [[nodiscard]] auto glob_match(std::string_view pattern, std::string_view str, char glob = '*') + -> bool; + + /******************** + * Implementation * + ********************/ + + namespace detail_parsers + { + template + constexpr auto concat_array(const Arr&... arrs) + { + auto out = std::array{}; + std::size_t out_idx = 0; + auto copy_one = [&](const auto& a) + { + for (const auto& x : a) + { + out[out_idx++] = x; + } + }; + (copy_one(arrs), ...); + return out; + } + + template + constexpr auto find(const std::array& arr, const T& val) -> std::size_t + { + std::size_t pos = N; + for (std::size_t i = 0; i < N; ++i) + { + const bool found = arr[i] == val; + pos = found ? i : pos; + } + return pos; + } + + inline auto front(char c) -> char + { + return c; + } + + inline auto front(std::string_view str) -> char + { + return str.front(); + } + + inline auto empty(char) -> bool + { + return false; + } + + inline auto empty(std::string_view str) -> bool + { + return str.empty(); + } + + struct FindParenthesesSearcher + { + auto find_first(std::string_view text, std::string_view token_str) + { + return text.find_first_of(token_str); + } + + auto find_next(std::string_view text, std::string_view token_str, std::size_t pos) + { + return text.find_first_of(token_str, pos + 1); + } + }; + + struct RFindParenthesesSearcher + { + auto find_first(std::string_view text, std::string_view token_str) + { + return text.find_last_of(token_str); + } + + auto find_next(std::string_view text, std::string_view token_str, std::size_t pos) + { + return (pos == 0) ? text.npos : text.find_last_of(token_str, pos - 1); + } + }; + + template + auto find_matching_parentheses_impl( + std::string_view text, + ParseError& err, + const std::array& open, + const std::array& close, + Searcher&& searcher + ) noexcept -> std::pair + { + // TODO(C++20): After allocating tokens and depths here, call an impl function using + // std::span defined in .cpp + static constexpr auto sv_npos = std::string_view::npos; + + const auto tokens = detail_parsers::concat_array(open, close); + const auto tokens_str = std::string_view(tokens.data(), tokens.size()); + + auto depths = std::array{}; // Plus one for branchless depths code + + const auto start = searcher.find_first(text, tokens_str); + if (start == sv_npos) + { + return { sv_npos, sv_npos }; + } + + auto pos = start; + while (pos != sv_npos) + { + // Change depth of corresponding open/close pair, writing in index P for + // the one not matching. + const auto open_depth_idx = detail_parsers::find(open, text[pos]); + const auto close_depth_idx = detail_parsers::find(close, text[pos]); + depths[open_depth_idx] += int(open_depth_idx < open.size()); + depths[close_depth_idx] -= int(close_depth_idx < open.size()); + // When open and close are the same character, depth did not change so we make + // a swap operation + depths[open_depth_idx] = if_else( + open_depth_idx == close_depth_idx, + if_else(depths[open_depth_idx] > 0, 0, 1), // swap 0 and 1 + depths[open_depth_idx] + ); + depths[P] = 0; + + // All parentheses are properly closed, we found the matching one. + if (depths == decltype(depths){}) + { + return { start, pos }; + } + + // Any negative depth means mismatched parentheses + for (auto d : depths) + { + err = if_else(d < 0, ParseError::InvalidInput, err); + } + + pos = searcher.find_next(text, tokens_str, pos); + } + + err = ParseError::InvalidInput; + return { start, sv_npos }; + } + + template + auto find_not_in_parentheses_impl( + std::string_view text, + const Str& val, + ParseError& err, + const std::array& open, + const std::array& close, + Searcher&& searcher + ) noexcept -> std::size_t + { + // TODO(C++20): After allocating tokens and depths here, call an impl function using + // std::span defined in .cpp + static constexpr auto sv_npos = std::string_view::npos; + + if (detail_parsers::empty(val)) + { + err = ParseError::InvalidInput; + return sv_npos; + } + + const auto tokens = detail_parsers::concat_array( + std::array{ detail_parsers::front(val) }, + open, + close + ); + const auto tokens_str = std::string_view(tokens.data(), tokens.size()); + + auto depths = std::array{}; // last for easy branchless access + auto first_val_pos = sv_npos; + auto pos = searcher.find_first(text, tokens_str); + while (pos != sv_npos) + { + const auto open_pos = detail_parsers::find(open, text[pos]); + const auto close_pos = detail_parsers::find(close, text[pos]); + depths[open_pos] += int(open_pos < open.size()); + depths[close_pos] -= int(close_pos < open.size()); + depths[open_pos] = if_else( + open_pos == close_pos, + if_else(depths[open_pos] > 0, 0, 1), // swap 0 and 1 + depths[open_pos] + ); + depths[P] = 0; + + for (auto d : depths) + { + err = if_else(d < 0, ParseError::InvalidInput, err); + } + const bool match = starts_with(text.substr(pos), val); + first_val_pos = if_else(match && (pos == sv_npos), pos, first_val_pos); + if (match && (depths == decltype(depths){})) + { + return pos; + } + pos = searcher.find_next(text, tokens_str, pos); + } + // Check if all parentheses are properly closed + if (depths != decltype(depths){}) + { + err = ParseError::InvalidInput; + return first_val_pos; + } + return sv_npos; // not found + } + } + + /******************************* + * find_matching_parentheses * + *******************************/ + + template + auto find_matching_parentheses( // + std::string_view text, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::pair + { + return detail_parsers::find_matching_parentheses_impl( + text, + err, + open, + close, + detail_parsers::FindParenthesesSearcher() + ); + } + + template + [[nodiscard]] auto find_matching_parentheses( // + std::string_view text, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected, ParseError> + { + auto err = ParseError::Ok; + auto out = find_matching_parentheses(text, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { out }; + } + + /******************************** + * rfind_matching_parentheses * + ********************************/ + + template + auto rfind_matching_parentheses( // + std::string_view text, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::pair + { + auto [last, first] = detail_parsers::find_matching_parentheses_impl( + text, + err, + close, // swapped + open, + detail_parsers::RFindParenthesesSearcher() + ); + return { first, last }; + } + + template + [[nodiscard]] auto rfind_matching_parentheses( // + std::string_view text, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected, ParseError> + { + auto err = ParseError::Ok; + auto out = rfind_matching_parentheses(text, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { out }; + } + + /***************************** + * find_not_in_parentheses * + *****************************/ + + template + auto find_not_in_parentheses( + std::string_view text, + char c, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::size_t + { + return detail_parsers::find_not_in_parentheses_impl( + text, + c, + err, + open, + close, + detail_parsers::FindParenthesesSearcher() + ); + } + + template + auto find_not_in_parentheses( + std::string_view text, + char c, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected + { + auto err = ParseError::Ok; + const auto pos = find_not_in_parentheses(text, c, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { pos }; + } + + template + auto find_not_in_parentheses( + std::string_view text, + std::string_view val, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::size_t + { + return detail_parsers::find_not_in_parentheses_impl( + text, + val, + err, + open, + close, + detail_parsers::FindParenthesesSearcher() + ); + } + + template + [[nodiscard]] auto find_not_in_parentheses( + std::string_view text, + std::string_view val, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected + { + auto err = ParseError::Ok; + const auto pos = find_not_in_parentheses(text, val, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { pos }; + } + + /****************************** + * rfind_not_in_parentheses * + ******************************/ + + template + auto rfind_not_in_parentheses( + std::string_view text, + char c, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::size_t + { + return detail_parsers::find_not_in_parentheses_impl( + text, + c, + err, + close, // swapped + open, + detail_parsers::RFindParenthesesSearcher() + ); + } + + template + auto rfind_not_in_parentheses( + std::string_view text, + char c, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected + { + auto err = ParseError::Ok; + const auto pos = rfind_not_in_parentheses(text, c, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { pos }; + } + + template + auto rfind_not_in_parentheses( + std::string_view text, + std::string_view val, + ParseError& err, + const std::array& open, + const std::array& close + ) noexcept -> std::size_t + { + return detail_parsers::find_not_in_parentheses_impl( + text, + val, + err, + close, // swapped + open, + detail_parsers::RFindParenthesesSearcher() + ); + } + + template + [[nodiscard]] auto rfind_not_in_parentheses( + std::string_view text, + std::string_view val, + const std::array& open, + const std::array& close + ) noexcept -> tl::expected + { + auto err = ParseError::Ok; + const auto pos = rfind_not_in_parentheses(text, val, err, open, close); + if (err != ParseError::Ok) + { + return tl::make_unexpected(err); + } + return { pos }; + } +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/path_manip.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/path_manip.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3e0db5e985405ee3f54c6d4cd247b5f26c5b1036 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/path_manip.hpp @@ -0,0 +1,125 @@ +// Copyright (c) 2023, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_PATH_MANIP_HPP +#define MAMBA_UTIL_PATH_MANIP_HPP + +#include +#include +#include + +namespace mamba::util +{ + /** + * Lightweight file path manipulation. + * + * The purpose of this file is to provide a lightweight functions for manipulating paths + * for things that manipulate "path-like" objects, such as parsers and URLs. + * In general, users should prefer using the correct abstraction, such as @ref URL + * and @ref u8path. + * However some features provided here, such as @ref expand_home, are not available elsewhere. + */ + + inline static constexpr char preferred_path_separator_posix = '/'; + inline static constexpr char preferred_path_separator_win = '\\'; + + /** + * Return true is the input is explicitly a path. + * + * Explicit path are: + * - Absolute path + * - Path starting with '~' + * - Relative paths starting with "./" or "../" + */ + [[nodiscard]] auto is_explicit_path(std::string_view input) -> bool; + + /** + * Return the path drive letter, if any, or none. + */ + [[nodiscard]] auto path_get_drive_letter(std::string_view path) -> std::optional; + + /** + * Check if a Windows path (not URL) starts with a drive letter. + */ + [[nodiscard]] auto path_has_drive_letter(std::string_view path) -> bool; + + /** + * Detect the separator used in a path. + */ + [[nodiscard]] auto path_win_detect_sep(std::string_view path) -> std::optional; + + /** + * Convert the Windows path separators to Posix ones. + */ + [[nodiscard]] auto path_win_to_posix(std::string path) -> std::string; + + /** + * Convert the Posix path separators to Windows ones. + */ + [[nodiscard]] auto path_posix_to_win(std::string path) -> std::string; + + /** + * Convert the path separators to the desired one. + */ + [[nodiscard]] auto path_to_sep(std::string path, char sep) -> std::string; + + /** + * Convert the Windows path separators to Posix ones on Windows only. + */ + [[nodiscard]] auto path_to_posix(std::string path) -> std::string; + + /** + * Check that a path is a prefix of another path. + */ + [[nodiscard]] auto + path_is_prefix(std::string_view parent, std::string_view child, char sep = '/') -> bool; + + /** + * Concatenate paths with the given separator. + */ + [[nodiscard]] auto path_concat(std::string_view parent, std::string_view child, char sep) + -> std::string; + + /** + * Concatenate paths with '/' on Unix and detected separator on Windows. + */ + [[nodiscard]] auto path_concat(std::string_view parent, std::string_view child) -> std::string; + + /** + * Expand a leading '~' with the given home directory, assuming the given separator. + */ + [[nodiscard]] auto expand_home(std::string_view path, std::string_view home, char sep) + -> std::string; + + /** + * Expand a leading '~' with the given home directory. + */ + [[nodiscard]] auto expand_home(std::string_view path, std::string_view home) -> std::string; + + /** + * Expand a leading '~' with the user home directory. + */ + [[nodiscard]] auto expand_home(std::string_view path) -> std::string; + + /** + * If the path starts with the given home directory, replace it with a leading '~'. + * + * This assumes the given separator is used separate paths. + */ + [[nodiscard]] auto shrink_home(std::string_view path, std::string_view home, char sep) + -> std::string; + + /** + * If the path starts with the given home directory, replace it with a leading '~'. + */ + [[nodiscard]] auto shrink_home(std::string_view path, std::string_view home) -> std::string; + + /** + * If the path starts with the user home directory, replace it with a leading '~'. + */ + [[nodiscard]] auto shrink_home(std::string_view path) -> std::string; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/random.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/random.hpp new file mode 100644 index 0000000000000000000000000000000000000000..327b28649470dfecf443829c7ed7c59c3fbb1591 --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/random.hpp @@ -0,0 +1,91 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_RANDOM_HPP +#define MAMBA_UTIL_RANDOM_HPP + +#include +#include +#include +#include +#include +#include +#include + +namespace mamba::util +{ + using default_random_generator = std::mt19937; + + template + [[nodiscard]] auto random_generator() -> Generator; + + template + auto local_random_generator() -> Generator&; + + template + auto random_int(T min, T max, Generator& generator = local_random_generator()) -> T; + + template + auto generate_random_alphanumeric_string( // + std::size_t len, + Generator& generator = local_random_generator() + ) -> std::string; + + /******************** + * Implementation * + ********************/ + + template + auto random_generator() -> Generator + { + using std::begin; + using std::end; + constexpr auto seed_bits = sizeof(typename Generator::result_type) * Generator::state_size; + constexpr auto seed_len = seed_bits / std::numeric_limits::digits; + auto seed = std::array{}; + auto dev = std::random_device{}; + std::generate_n(begin(seed), seed_len, std::ref(dev)); + auto seed_seq = std::seed_seq(begin(seed), end(seed)); + return Generator{ seed_seq }; + } + + extern template auto random_generator() -> default_random_generator; + + template + auto local_random_generator() -> Generator& + { + thread_local auto rng = random_generator(); + return rng; + } + + extern template auto local_random_generator() + -> default_random_generator&; + + template + auto random_int(T min, T max, Generator& generator) -> T + { + return std::uniform_int_distribution{ min, max }(generator); + } + + template + auto generate_random_alphanumeric_string(std::size_t len, Generator& generator) -> std::string + { + static constexpr auto chars = std::string_view{ + "0123456789" + "abcdefghijklmnopqrstuvwxyz", + }; + auto dist = std::uniform_int_distribution{ {}, chars.size() - 1 }; + auto result = std::string(len, '\0'); + std::generate_n(begin(result), len, [&]() { return chars[dist(generator)]; }); + return result; + } + + extern template auto generate_random_alphanumeric_string( + std::size_t len, + default_random_generator& generator + ) -> std::string; +} +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/string.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/string.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4c4133041211993bd36d1ac0a392d563d864ad1c --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/string.hpp @@ -0,0 +1,731 @@ +// Copyright (c) 2019, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_CORE_UTIL_STRING_HPP +#define MAMBA_CORE_UTIL_STRING_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mamba::util +{ + /** + * Return the string if the pointer is not null, otherwise a pointer to an empty string. + */ + [[nodiscard]] auto raw_str_or_empty(const char* ptr) -> const char*; + + /** + * Safe non utf-8 wrapping of (see its doc). + */ + [[nodiscard]] auto is_control(char c) -> bool; + [[nodiscard]] auto is_control(wchar_t c) -> bool; + [[nodiscard]] auto is_print(char c) -> bool; + [[nodiscard]] auto is_print(wchar_t c) -> bool; + [[nodiscard]] auto is_space(char c) -> bool; + [[nodiscard]] auto is_space(wchar_t c) -> bool; + [[nodiscard]] auto is_blank(char c) -> bool; + [[nodiscard]] auto is_blank(wchar_t c) -> bool; + [[nodiscard]] auto is_graphic(char c) -> bool; + [[nodiscard]] auto is_graphic(wchar_t c) -> bool; + [[nodiscard]] auto is_digit(char c) -> bool; + [[nodiscard]] auto is_digit(wchar_t c) -> bool; + [[nodiscard]] auto is_punct(char c) -> bool; + [[nodiscard]] auto is_punct(wchar_t c) -> bool; + [[nodiscard]] auto is_alpha(char c) -> bool; + [[nodiscard]] auto is_alpha(wchar_t c) -> bool; + [[nodiscard]] auto is_alphanum(char c) -> bool; + [[nodiscard]] auto is_alphanum(wchar_t c) -> bool; + [[nodiscard]] auto is_lower(char c) -> bool; + [[nodiscard]] auto is_lower(wchar_t c) -> bool; + [[nodiscard]] auto is_upper(char c) -> bool; + [[nodiscard]] auto is_upper(wchar_t c) -> bool; + [[nodiscard]] auto to_lower(char c) -> char; + [[nodiscard]] auto to_lower(wchar_t c) -> wchar_t; + + [[nodiscard]] auto to_lower(std::string_view str) -> std::string; + [[nodiscard]] auto to_lower(std::wstring_view str) -> std::wstring; + // The use of a template here serves to exclude the overload for const Char* + template + [[nodiscard]] auto to_lower(std::basic_string&& str) -> std::basic_string; + extern template std::string to_lower(std::string&& str); + extern template std::wstring to_lower(std::wstring&& str); + + [[nodiscard]] auto to_upper(char c) -> char; + [[nodiscard]] auto to_upper(wchar_t c) -> wchar_t; + [[nodiscard]] auto to_upper(std::string_view str) -> std::string; + [[nodiscard]] auto to_upper(std::wstring_view str) -> std::wstring; + // The use of a template here serves to exclude the overload for const Char* + template + [[nodiscard]] auto to_upper(std::basic_string&& str) -> std::basic_string; + extern template std::string to_upper(std::string&& str); + extern template std::wstring to_upper(std::wstring&& str); + + [[nodiscard]] auto starts_with(std::string_view str, std::string_view prefix) -> bool; + [[nodiscard]] auto starts_with(std::string_view str, std::string_view::value_type c) -> bool; + + [[nodiscard]] auto ends_with(std::string_view str, std::string_view suffix) -> bool; + [[nodiscard]] auto ends_with(std::string_view str, std::string_view::value_type c) -> bool; + + [[nodiscard]] auto contains(std::string_view str, std::string_view sub_str) -> bool; + [[nodiscard]] auto contains(std::string_view str, char c) -> bool; + [[nodiscard]] auto contains(char c1, char c2) -> bool; + + /** + * Check if any of the strings starts with the prefix. + */ + template + [[nodiscard]] auto any_starts_with(const StrRange& strs, std::string_view prefix) -> bool; + template + [[nodiscard]] auto any_starts_with(const StrRange& strs, std::wstring_view prefix) -> bool; + + /** + * Check if the string starts with any of the prefix. + */ + template + [[nodiscard]] auto starts_with_any(std::string_view str, const StrRange& prefix) -> bool; + template + [[nodiscard]] auto starts_with_any(std::wstring_view str, const StrRange& prefix) -> bool; + + /** + * Return a view to the input without the prefix if present. + */ + [[nodiscard]] auto remove_prefix(std::string_view str, std::string_view prefix) + -> std::string_view; + [[nodiscard]] auto remove_prefix(std::string_view str, std::string_view::value_type c) + -> std::string_view; + + /** + * Return a view to prefix if present, and a view to the rest of the input. + */ + [[nodiscard]] auto split_prefix(std::string_view str, std::string_view prefix) + -> std::array; + [[nodiscard]] auto split_prefix(std::string_view str, std::string_view::value_type c) + -> std::array; + + /** + * Return a view to the input without the suffix if present. + */ + [[nodiscard]] auto remove_suffix(std::string_view str, std::string_view suffix) + -> std::string_view; + [[nodiscard]] auto remove_suffix(std::string_view str, std::string_view::value_type c) + -> std::string_view; + + /** + * Return a view to the head of the input, and a view to suffix if present. + */ + [[nodiscard]] auto split_suffix(std::string_view str, std::string_view suffix) + -> std::array; + [[nodiscard]] auto split_suffix(std::string_view str, std::string_view::value_type c) + -> std::array; + + [[nodiscard]] auto lstrip(std::string_view input, char c) -> std::string_view; + [[nodiscard]] auto lstrip(std::wstring_view input, wchar_t c) -> std::wstring_view; + [[nodiscard]] auto lstrip(std::string_view input, std::string_view chars) -> std::string_view; + [[nodiscard]] auto lstrip(std::wstring_view input, std::wstring_view chars) -> std::wstring_view; + [[nodiscard]] auto lstrip(std::string_view input) -> std::string_view; + [[nodiscard]] auto lstrip(std::wstring_view input) -> std::wstring_view; + + [[nodiscard]] auto lstrip_parts(std::string_view input, char c) + -> std::array; + [[nodiscard]] auto lstrip_parts(std::wstring_view input, wchar_t c) + -> std::array; + [[nodiscard]] auto lstrip_parts(std::string_view input, std::string_view chars) + -> std::array; + [[nodiscard]] auto lstrip_parts(std::wstring_view input, std::wstring_view chars) + -> std::array; + + template + [[nodiscard]] auto lstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view; + template + [[nodiscard]] auto lstrip_if(std::wstring_view input, UnaryFunc should_strip) + -> std::wstring_view; + + template + [[nodiscard]] auto lstrip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array; + template + [[nodiscard]] auto lstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array; + + [[nodiscard]] auto rstrip(std::string_view input, char c) -> std::string_view; + [[nodiscard]] auto rstrip(std::wstring_view input, wchar_t c) -> std::wstring_view; + [[nodiscard]] auto rstrip(std::string_view input, std::string_view chars) -> std::string_view; + [[nodiscard]] auto rstrip(std::wstring_view input, std::wstring_view chars) -> std::wstring_view; + [[nodiscard]] auto rstrip(std::string_view input) -> std::string_view; + [[nodiscard]] auto rstrip(std::wstring_view input) -> std::wstring_view; + + [[nodiscard]] auto rstrip_parts(std::string_view input, char c) + -> std::array; + [[nodiscard]] auto rstrip_parts(std::wstring_view input, wchar_t c) + -> std::array; + [[nodiscard]] auto rstrip_parts(std::string_view input, std::string_view chars) + -> std::array; + [[nodiscard]] auto rstrip_parts(std::wstring_view input, std::wstring_view chars) + -> std::array; + + template + [[nodiscard]] auto rstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view; + template + [[nodiscard]] auto rstrip_if(std::wstring_view input, UnaryFunc should_strip) + -> std::wstring_view; + + template + [[nodiscard]] auto rstrip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array; + template + [[nodiscard]] auto rstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array; + + [[nodiscard]] auto strip(std::string_view input, char c) -> std::string_view; + [[nodiscard]] auto strip(std::wstring_view input, wchar_t c) -> std::wstring_view; + [[nodiscard]] auto strip(std::string_view input, std::string_view chars) -> std::string_view; + [[nodiscard]] auto strip(std::wstring_view input, std::wstring_view chars) -> std::wstring_view; + [[nodiscard]] auto strip(std::string_view input) -> std::string_view; + [[nodiscard]] auto strip(std::wstring_view input) -> std::wstring_view; + + /** + * Dedicated implementation for inplace stripping of `std::string` to avoid copies + */ + void inplace_strip(std::string& input); + + [[nodiscard]] auto strip_parts(std::string_view input, char c) -> std::array; + [[nodiscard]] auto strip_parts(std::wstring_view input, wchar_t c) + -> std::array; + [[nodiscard]] auto strip_parts(std::string_view input, std::string_view chars) + -> std::array; + [[nodiscard]] auto strip_parts(std::wstring_view input, std::wstring_view chars) + -> std::array; + + template + [[nodiscard]] auto strip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view; + template + [[nodiscard]] auto strip_if(std::wstring_view input, UnaryFunc should_strip) + -> std::wstring_view; + + template + [[nodiscard]] auto strip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array; + template + [[nodiscard]] auto strip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array; + + [[nodiscard]] auto split_once(std::string_view str, char sep) + -> std::tuple>; + [[nodiscard]] auto split_once(std::string_view str, std::string_view sep) + -> std::tuple>; + + [[nodiscard]] auto rsplit_once(std::string_view str, char sep) + -> std::tuple, std::string_view>; + [[nodiscard]] auto rsplit_once(std::string_view str, std::string_view sep) + -> std::tuple, std::string_view>; + + [[nodiscard]] auto split_once_on_any(std::string_view str, std::string_view many_seps) + -> std::tuple>; + template + [[nodiscard]] auto split_once_on_any(std::string_view str, std::array many_seps) + -> std::tuple>; + + [[nodiscard]] auto rsplit_once_on_any(std::string_view str, std::string_view many_seps) + -> std::tuple, std::string_view>; + template + [[nodiscard]] auto rsplit_once_on_any(std::string_view str, std::array many_seps) + -> std::tuple, std::string_view>; + + [[nodiscard]] auto + split(std::string_view input, std::string_view sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto split(std::string_view input, char sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto + split(std::wstring_view input, std::wstring_view sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto split(std::wstring_view input, wchar_t sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + + [[nodiscard]] auto + rsplit(std::string_view input, std::string_view sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto rsplit(std::string_view input, char sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto + rsplit(std::wstring_view input, std::wstring_view sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + [[nodiscard]] auto rsplit(std::wstring_view input, wchar_t sep, std::size_t max_split = SIZE_MAX) + -> std::vector; + + /** + * Concatenate string while removing the suffix of the first that may be prefix of second. + * + * Comparison are done as if comparing elements in a split given by @p sep. + * For instance "private/channel" and "channel/label/foo" with separator "/" + * would return "private/channel/label/foo", but "private/chan" and "channel/label/foo" + * would return the "private/chan/channel/label/foo". + */ + [[nodiscard]] auto concat_dedup_splits(std::string_view str1, std::string_view str2, char sep) + -> std::string; + [[nodiscard]] auto + concat_dedup_splits(std::string_view str1, std::string_view str2, std::string_view sep) + -> std::string; + + void replace_all(std::string& data, std::string_view search, std::string_view replace); + void replace_all(std::wstring& data, std::wstring_view search, std::wstring_view replace); + + namespace detail + { + struct PlusEqual + { + template + auto operator()(T& left, const U& right); + }; + } + + /** + * Execute the function @p func on each element of a join iteration. + * + * The join iteration of an iterator pair (@p first, @p last) with a separator @p sep is + * defined by iterating through the ``n`` elements of the iterator pair, interleaving the + * separator in between the elements (thus appearing ``n-1`` times). + */ + template + auto join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep) + -> UnaryFunction; + + /** + * Concatenate the elements of the container @p container by interleaving a separator. + * + * Joining is done by successively joining (using the provided @p joiner) the aggregate with + * element of the container and the separator, such that the separator only appears + * in-between two elements of the range. + * + * @see join_for_each + */ + template + auto join(const Value& sep, const Range& container, Joiner joiner = detail::PlusEqual{}) -> + typename Range::value_type; + + /** + * Execute the function @p func on each element of a tuncated join iteration. + * + * The join iteration of an iterator pair (@p first, @p last) with a separator @p sep + * and a truncation symbol @p etc is define by the join iteration of either all the elements + * in the iterator pair if they are less than @p threshold, a limited number of elements, with + * middle elements represented by @p etc. + * defined by iterating through the ``n`` elements of the iterator pair, interleaving the + * separator in between the elements (thus appearing ``n-1`` times). + * + * @param first The iterator pointing to the beginning of the range of elements to join. + * @param last The iterator pointing to past the end of the range of elements to join. + * @param func The unary function to apply to all elements (separation and truncation included). + * @param sep The separator used in between elements. + * @param etc The value used to represent the truncation of the elements. + * @param threshold Distance between the iterator pair beyond which truncation is preformed. + * @param show Number of elements to keep at the begining/end when truncation is preformed. + * + * @see join_for_each + */ + template + auto join_trunc_for_each( + InputIt first, + InputIt last, + UnaryFunction func, + const Value& sep, + const Value& etc, + std::size_t threshold = 5, + std::pair show = { 2, 1 } + ) -> UnaryFunction; + + /** + * Join elements of a range, with possible truncation. + * + * @param range Elements to join. + * @param sep The separator used in between elements. + * @param etc The value used to represent the truncation of the elements. + * @param threshold Distance between the iterator pair beyond which truncation is preformed. + * @param show Number of elements to keep at the begining/end when truncation is preformed. + * + * @see join_trunc_for_each + * @see join + */ + template + auto join_trunc( + const Range& range, + std::string_view sep = ", ", + std::string_view etc = "...", + std::size_t threshold = 5, + std::pair show = { 2, 1 }, + Joiner joiner = detail::PlusEqual{} + ) -> typename Range::value_type; + ; + + /************************ + * Implementation misc * + ************************/ + + inline auto raw_str_or_empty(const char* ptr) -> const char* + { + return ptr ? ptr : ""; + } + + /******************************************** + * Implementation of start_with functions * + ********************************************/ + + template + auto any_starts_with(const StrRange& strs, std::basic_string_view prefix) -> bool + { + return std::any_of( + strs.cbegin(), + strs.cend(), + [&prefix](const auto& s) { return starts_with(s, prefix); } + ); + } + + template + auto any_starts_with(const StrRange& strs, std::string_view prefix) -> bool + { + return any_starts_with(strs, prefix); + } + + template + auto any_starts_with(const StrRange& strs, std::wstring_view prefix) -> bool + { + return any_starts_with(strs, prefix); + } + + extern template bool any_starts_with(const std::vector&, std::string_view); + extern template bool any_starts_with(const std::vector&, std::string_view); + + template + auto starts_with_any(std::basic_string_view str, const StrRange& prefix) -> bool + { + return std::any_of( + prefix.cbegin(), + prefix.cend(), + [&str](const auto& p) { return starts_with(str, p); } + ); + } + + template + auto starts_with_any(std::string_view str, const StrRange& prefix) -> bool + { + return starts_with_any(str, prefix); + } + + template + auto starts_with_any(std::wstring_view str, const StrRange& prefix) -> bool + { + return starts_with_any(str, prefix); + } + + extern template bool starts_with_any(std::string_view, const std::vector&); + extern template bool starts_with_any(std::string_view, const std::vector&); + + /*************************************** + * Implementation of strip functions * + ***************************************/ + + namespace detail + { + template + auto lstrip_if_parts_impl(std::basic_string_view input, UnaryFunc should_strip) + -> std::array, 2> + { + const auto start_iter = std::find_if( + input.cbegin(), + input.cend(), + [&should_strip](Char c) -> bool { return !should_strip(c); } + ); + const auto start_idx = static_cast(start_iter - input.cbegin()); + return { input.substr(0, start_idx), input.substr(start_idx) }; + } + } + + template + auto lstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view + { + return lstrip_if_parts(input, std::move(should_strip))[1]; + } + + template + auto lstrip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view + { + return lstrip_if_parts(input, std::move(should_strip))[1]; + } + + template + auto lstrip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array + { + return detail::lstrip_if_parts_impl(input, std::move(should_strip)); + } + + template + auto lstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array + { + return detail::lstrip_if_parts_impl(input, std::move(should_strip)); + } + + namespace detail + { + template + auto rstrip_if_parts_impl(std::basic_string_view input, UnaryFunc should_strip) + -> std::array, 2> + { + const auto rstart_iter = std::find_if( + input.crbegin(), + input.crend(), + [&should_strip](Char c) -> bool { return !should_strip(c); } + ); + const auto past_end_idx = static_cast(input.crend() - rstart_iter); + return { input.substr(0, past_end_idx), input.substr(past_end_idx) }; + } + } + + template + auto rstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view + { + return rstrip_if_parts(input, std::move(should_strip))[0]; + } + + template + auto rstrip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view + { + return rstrip_if_parts(input, std::move(should_strip))[0]; + } + + template + auto rstrip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array + { + return detail::rstrip_if_parts_impl(input, std::move(should_strip)); + } + + template + auto rstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array + { + return detail::rstrip_if_parts_impl(input, std::move(should_strip)); + } + + namespace detail + { + template + auto strip_if_parts_impl(std::basic_string_view input, UnaryFunc should_strip) + -> std::array, 3> + { + const auto [head, not_head] = lstrip_if_parts(input, should_strip); + const auto [body, tail] = rstrip_if_parts(not_head, std::move(should_strip)); + return { head, body, tail }; + } + } + + template + auto strip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view + { + return strip_if_parts(input, std::move(should_strip))[1]; + } + + template + auto strip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view + { + return strip_if_parts(input, std::move(should_strip))[1]; + } + + template + auto strip_if_parts(std::string_view input, UnaryFunc should_strip) + -> std::array + { + return detail::strip_if_parts_impl(input, std::move(should_strip)); + } + + template + auto strip_if_parts(std::wstring_view input, UnaryFunc should_strip) + -> std::array + { + return detail::strip_if_parts_impl(input, std::move(should_strip)); + } + + template + auto split_once_on_any(std::string_view str, std::array many_seps) + -> std::tuple> + { + return split_once_on_any(str, std::string_view{ many_seps.data(), many_seps.size() }); + } + + template + auto rsplit_once_on_any(std::string_view str, std::array many_seps) + -> std::tuple, std::string_view> + { + return rsplit_once_on_any(str, std::string_view{ many_seps.data(), many_seps.size() }); + } + + /************************************** + * Implementation of join functions * + **************************************/ + + namespace detail + { + template + auto PlusEqual::operator()(T& left, const U& right) + { + left += right; + } + + template + struct has_reserve : std::false_type + { + }; + + template + struct has_reserve().reserve(std::size_t()))>> + : std::true_type + { + }; + + template + inline constexpr bool has_reserve_v = has_reserve::value; + + auto length(const char* s) -> std::size_t; + auto length(const wchar_t* s) -> std::size_t; + auto length(const char c) -> std::size_t; + auto length(const wchar_t c) -> std::size_t; + + template + auto length(const T& s) -> std::size_t + { + return s.length(); + } + } + + // TODO(C++20) Use ``std::ranges::join_view`` (or ``std::ranges::join``) + template + auto join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep) + -> UnaryFunction + { + if (first < last) + { + func(*(first++)); + for (; first < last; ++first) + { + func(sep); + func(*first); + } + } + return func; + } + + template + auto join(const Value& sep, const Range& container, Joiner joiner) -> typename Range::value_type + { + using Result = typename Range::value_type; + Result out{}; + if constexpr (detail::has_reserve_v) + { + std::size_t final_size = 0; + auto inc_size = [&final_size](const auto& val) { final_size += detail::length(val); }; + join_for_each(container.begin(), container.end(), inc_size, sep); + out.reserve(final_size); + } + auto out_joiner = [&](auto&& val) { joiner(out, std::forward(val)); }; + join_for_each(container.begin(), container.end(), out_joiner, sep); + return out; + } + + /******************************************** + * Implementation of join_trunc functions * + ********************************************/ + + // TODO(C++20) Take an input range and return a range + template + auto join_trunc_for_each( + InputIt first, + InputIt last, + UnaryFunction func, + const Value& sep, + const Value& etc, + std::size_t threshold, + std::pair show + ) -> UnaryFunction + { + if (std::cmp_less_equal(last - first, threshold)) + { + return join_for_each(first, last, std::move(func), sep); + } + + // Working around non-assignable function types, such as lambda with references. + auto join_for_each_func = [&func](auto f, auto l, auto val) + { + if constexpr (std::is_assignable_v) + { + func = join_for_each(f, l, std::move(func), val); + } + else + { + join_for_each(f, l, func, val); + } + }; + + const auto [show_head, show_tail] = show; + if (show_head > 0) + { + join_for_each_func(first, first + static_cast(show_head), sep); + func(sep); + } + func(etc); + if (show_tail) + { + func(sep); + join_for_each_func(last - static_cast(show_tail), last, sep); + } + return func; + } + + template + auto join_trunc( + const Range& range, + std::string_view sep, + std::string_view etc, + std::size_t threshold, + std::pair show, + Joiner joiner + ) -> typename Range::value_type + { + using Result = typename Range::value_type; + Result out{}; + if constexpr (detail::has_reserve_v) + { + std::size_t final_size = 0; + auto inc_size = [&final_size](const auto& val) { final_size += detail::length(val); }; + join_trunc_for_each(range.begin(), range.end(), inc_size, sep, etc, threshold, show); + out.reserve(final_size); + } + + auto out_joiner = [&](auto&& val) { joiner(out, std::forward(val)); }; + join_trunc_for_each(range.begin(), range.end(), out_joiner, sep, etc, threshold, show); + return out; + } + + template + auto concat(const Args&... args) -> std::string + { + std::string result; + result.reserve((detail::length(args) + ...)); + ((result += args), ...); + return result; + } +} + +#endif diff --git a/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/synchronized_value.hpp b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/synchronized_value.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ca0df00dfb7978de52a76b9c21a1e856205f708f --- /dev/null +++ b/miniconda3/pkgs/libmamba-2.3.2-h860b5fb_1/include/mamba/util/synchronized_value.hpp @@ -0,0 +1,795 @@ +// Copyright (c) 2025, QuantStack and Mamba Contributors +// +// Distributed under the terms of the BSD 3-Clause License. +// +// The full license is in the file LICENSE, distributed with this software. + +#ifndef MAMBA_UTIL_SYNCHRONIZED_VALUE_HPP +#define MAMBA_UTIL_SYNCHRONIZED_VALUE_HPP + +#include +#include +#include +#include +#include +#include + +namespace mamba::util +{ + ///////////////////////////// + // TODO: move that in a more general location + // original: https://github.com/man-group/sparrow/blob/main/include/sparrow/utils/mp_utils.hpp + + + template class U> + struct is_type_instance_of : std::false_type + { + }; + + template